three-stdlib 2.8.1 → 2.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. package/{BufferGeometryUtils-582025b8.js → BufferGeometryUtils-1a7a235c.js} +2 -1
  2. package/{BufferGeometryUtils-9eb5c2e7.js → BufferGeometryUtils-971dfde3.js} +0 -0
  3. package/animation/MMDAnimationHelper.d.ts +17 -17
  4. package/animation/MMDPhysics.d.ts +3 -3
  5. package/csm/CSM.d.ts +47 -22
  6. package/csm/CSMHelper.d.ts +20 -7
  7. package/effects/OutlineEffect.d.ts +4 -4
  8. package/effects/OutlineEffect.js +8 -2
  9. package/exporters/GLTFExporter.js +5 -10
  10. package/geometries/ConvexGeometry.d.ts +1 -1
  11. package/geometries/ParametricGeometries.d.ts +4 -2
  12. package/helpers/RectAreaLightHelper.d.ts +3 -3
  13. package/index.cjs.js +1 -1
  14. package/index.d.ts +9 -4
  15. package/index.js +9 -4
  16. package/libs/MotionControllers.cjs.js +1 -0
  17. package/libs/MotionControllers.js +403 -0
  18. package/loaders/AssimpLoader.js +39 -10
  19. package/loaders/ColladaLoader.js +22 -5
  20. package/loaders/EXRLoader.js +5 -1
  21. package/loaders/FBXLoader.js +10 -2
  22. package/loaders/GLTFLoader.cjs.js +1 -1
  23. package/loaders/GLTFLoader.d.ts +44 -20
  24. package/loaders/GLTFLoader.js +0 -2
  25. package/loaders/LDrawLoader.d.ts +6 -0
  26. package/loaders/MTLLoader.d.ts +18 -18
  27. package/loaders/RGBMLoader.d.ts +10 -10
  28. package/loaders/RGBMLoader.js +253 -178
  29. package/loaders/SVGLoader.d.ts +5 -3
  30. package/loaders/SVGLoader.js +10 -5
  31. package/loaders/lwo/IFFParser.js +4 -1
  32. package/math/OBB.d.ts +1 -1
  33. package/misc/GPUComputationRenderer.d.ts +8 -6
  34. package/misc/MD2CharacterComplex.js +9 -2
  35. package/misc/Volume.d.ts +2 -0
  36. package/modifiers/EdgeSplitModifier.cjs.js +1 -1
  37. package/modifiers/SimplifyModifier.cjs.js +1 -1
  38. package/nodes/inputs/ColorNode.d.ts +2 -2
  39. package/nodes/inputs/TextureNode.d.ts +3 -2
  40. package/nodes/materials/StandardNodeMaterial.d.ts +1 -1
  41. package/nodes/materials/nodes/StandardNode.d.ts +1 -0
  42. package/nodes/utils/ColorSpaceNode.d.ts +1 -1
  43. package/nodes/utils/JoinNode.d.ts +1 -0
  44. package/objects/MarchingCubes.d.ts +12 -4
  45. package/objects/Reflector.d.ts +4 -2
  46. package/objects/ReflectorForSSRPass.d.ts +6 -6
  47. package/objects/Refractor.d.ts +4 -2
  48. package/objects/Water.d.ts +4 -3
  49. package/objects/Water2.d.ts +12 -3
  50. package/package.json +2 -3
  51. package/postprocessing/ClearPass.d.ts +3 -3
  52. package/postprocessing/SAOPass.d.ts +3 -2
  53. package/postprocessing/SSAARenderPass.d.ts +3 -3
  54. package/postprocessing/SSAOPass.d.ts +3 -2
  55. package/postprocessing/SSRPass.d.ts +14 -17
  56. package/postprocessing/TAARenderPass.d.ts +2 -2
  57. package/renderers/CSS2DRenderer.d.ts +5 -1
  58. package/renderers/CSS3DRenderer.d.ts +5 -1
  59. package/renderers/webgpu/WebGPUTextures.js +62 -41
  60. package/shaders/SSRShader.d.ts +1 -2
  61. package/utils/BufferGeometryUtils.cjs.js +1 -1
  62. package/utils/BufferGeometryUtils.js +2 -1
  63. package/utils/LDrawUtils.cjs.js +1 -1
  64. package/utils/LDrawUtils.d.ts +5 -0
  65. package/utils/LDrawUtils.js +1 -1
  66. package/utils/RoughnessMipmapper.js +5 -1
  67. package/utils/SceneUtils.d.ts +10 -12
  68. package/utils/ShadowMapViewer.js +4 -1
  69. package/webxr/OculusHandModel.cjs.js +1 -0
  70. package/webxr/OculusHandModel.d.ts +19 -0
  71. package/webxr/OculusHandModel.js +72 -0
  72. package/webxr/OculusHandPointerModel.cjs.js +1 -0
  73. package/webxr/OculusHandPointerModel.d.ts +63 -0
  74. package/webxr/OculusHandPointerModel.js +248 -0
  75. package/webxr/Text2D.cjs.js +1 -0
  76. package/webxr/Text2D.d.ts +3 -0
  77. package/webxr/Text2D.js +32 -0
  78. package/webxr/VRButton.cjs.js +1 -1
  79. package/webxr/VRButton.js +17 -1
  80. package/webxr/XRControllerModelFactory.cjs.js +1 -1
  81. package/webxr/XRControllerModelFactory.js +65 -66
  82. package/webxr/XREstimatedLight.cjs.js +1 -1
  83. package/webxr/XREstimatedLight.js +1 -0
  84. package/webxr/XRHandMeshModel.cjs.js +1 -0
  85. package/webxr/XRHandMeshModel.d.ts +11 -0
  86. package/webxr/XRHandMeshModel.js +55 -0
  87. package/webxr/XRHandModelFactory.cjs.js +1 -1
  88. package/webxr/XRHandModelFactory.d.ts +3 -3
  89. package/webxr/XRHandModelFactory.js +47 -50
  90. package/webxr/XRHandPrimitiveModel.cjs.js +1 -1
  91. package/webxr/XRHandPrimitiveModel.d.ts +1 -1
  92. package/webxr/XRHandPrimitiveModel.js +31 -41
  93. package/csm/Frustum.d.ts +0 -16
  94. package/csm/Shader.d.ts +0 -6
  95. package/loaders/XLoader.d.ts +0 -19
  96. package/shaders/FresnelShader.d.ts +0 -13
  97. package/shaders/ParallaxShader.d.ts +0 -20
  98. package/utils/RoughnessMipmapper.d.ts +0 -7
  99. package/webxr/XRHandOculusMeshModel.cjs.js +0 -1
  100. package/webxr/XRHandOculusMeshModel.d.ts +0 -23
  101. package/webxr/XRHandOculusMeshModel.js +0 -89
@@ -284,10 +284,17 @@ var MD2CharacterComplex = function () {
284
284
 
285
285
  if (controls.crouch) this.maxSpeed = this.crouchSpeed;else this.maxSpeed = this.walkSpeed;
286
286
  this.maxReverseSpeed = -this.maxSpeed;
287
- if (controls.moveForward) this.speed = MathUtils.clamp(this.speed + delta * this.frontAcceleration, this.maxReverseSpeed, this.maxSpeed);
288
- if (controls.moveBackward) this.speed = MathUtils.clamp(this.speed - delta * this.backAcceleration, this.maxReverseSpeed, this.maxSpeed); // orientation based on controls
287
+
288
+ if (controls.moveForward) {
289
+ this.speed = MathUtils.clamp(this.speed + delta * this.frontAcceleration, this.maxReverseSpeed, this.maxSpeed);
290
+ }
291
+
292
+ if (controls.moveBackward) {
293
+ this.speed = MathUtils.clamp(this.speed - delta * this.backAcceleration, this.maxReverseSpeed, this.maxSpeed);
294
+ } // orientation based on controls
289
295
  // (don't just stand while turning)
290
296
 
297
+
291
298
  var dir = 1;
292
299
 
293
300
  if (controls.moveLeft) {
package/misc/Volume.d.ts CHANGED
@@ -9,6 +9,8 @@ export class Volume {
9
9
  yLength: number;
10
10
  zLength: number;
11
11
 
12
+ axisOrder: Array<'x' | 'y' | 'z'>;
13
+
12
14
  data: ArrayLike<number>;
13
15
 
14
16
  spacing: number[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/defineProperty"),e=require("three"),s=require("../BufferGeometryUtils-9eb5c2e7.js");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}require("../types/helpers.cjs.js");var o=i(t);exports.EdgeSplitModifier=class{constructor(){o.default(this,"A",new e.Vector3),o.default(this,"B",new e.Vector3),o.default(this,"C",new e.Vector3),o.default(this,"positions",[]),o.default(this,"normals",new Float32Array),o.default(this,"indexes",[]),o.default(this,"pointToIndexMap",[]),o.default(this,"splitIndexes",[]),o.default(this,"oldNormals",[]),o.default(this,"computeNormals",(()=>{this.normals=new Float32Array(3*this.indexes.length);for(let t=0;t<this.indexes.length;t+=3){let e=this.indexes[t];this.A.set(this.positions[3*e],this.positions[3*e+1],this.positions[3*e+2]),e=this.indexes[t+1],this.B.set(this.positions[3*e],this.positions[3*e+1],this.positions[3*e+2]),e=this.indexes[t+2],this.C.set(this.positions[3*e],this.positions[3*e+1],this.positions[3*e+2]),this.C.sub(this.B),this.A.sub(this.B);const s=this.C.cross(this.A).normalize();for(let e=0;e<3;e++)this.normals[3*(t+e)]=s.x,this.normals[3*(t+e)+1]=s.y,this.normals[3*(t+e)+2]=s.z}})),o.default(this,"mapPositionsToIndexes",(()=>{this.pointToIndexMap=Array(this.positions.length/3);for(let t=0;t<this.indexes.length;t++){const e=this.indexes[t];null==this.pointToIndexMap[e]&&(this.pointToIndexMap[e]=[]),this.pointToIndexMap[e].push(t)}})),o.default(this,"edgeSplitToGroups",((t,e,s)=>{this.A.set(this.normals[3*s],this.normals[3*s+1],this.normals[3*s+2]).normalize();const i={splitGroup:[],currentGroup:[s]};for(let o of t)o!==s&&(this.B.set(this.normals[3*o],this.normals[3*o+1],this.normals[3*o+2]).normalize(),this.B.dot(this.A)<e?i.splitGroup.push(o):i.currentGroup.push(o));return i})),o.default(this,"edgeSplit",((t,e,s=null)=>{if(0===t.length)return;const i=[];for(let s of t)i.push(this.edgeSplitToGroups(t,e,s));let o=i[0];for(let t of i)t.currentGroup.length>o.currentGroup.length&&(o=t);null!=s&&this.splitIndexes.push({original:s,indexes:o.currentGroup}),o.splitGroup.length&&this.edgeSplit(o.splitGroup,e,s||o.currentGroup[0])})),o.default(this,"modify",((t,i,o=!0)=>{let r=!1;if(t.attributes.normal&&(r=!0,t=t.clone(),!0===o&&null!==t.index&&(this.oldNormals=t.attributes.normal.array),t.deleteAttribute("normal")),null==t.index){if(void 0===s.BufferGeometryUtils)throw"THREE.EdgeSplitModifier relies on BufferGeometryUtils";t=s.mergeVertices(t)}this.indexes=t.index.array,this.positions=t.getAttribute("position").array,this.computeNormals(),this.mapPositionsToIndexes(),this.splitIndexes=[];for(let t of this.pointToIndexMap)this.edgeSplit(t,Math.cos(i)-.001);const n={};for(let s of Object.keys(t.attributes)){const i=t.attributes[s],o=new i.array.constructor((this.indexes.length+this.splitIndexes.length)*i.itemSize);o.set(i.array),n[s]=new e.BufferAttribute(o,i.itemSize,i.normalized)}const l=new Uint32Array(this.indexes.length);l.set(this.indexes);for(let t=0;t<this.splitIndexes.length;t++){const e=this.splitIndexes[t],s=this.indexes[e.original];for(let e of Object.values(n))for(let i=0;i<e.itemSize;i++)e.array[(this.indexes.length+t)*e.itemSize+i]=e.array[s*e.itemSize+i];for(let s of e.indexes)l[s]=this.indexes.length+t}(t=new e.BufferGeometry).setIndex(new e.BufferAttribute(l,1));for(let e of Object.keys(n))t.setAttribute(e,n[e]);if(r&&(t.computeVertexNormals(),null!==this.oldNormals)){const e=new Array(this.oldNormals.length/3).fill(!1);for(let t of this.splitIndexes)e[t.original]=!0;for(let s=0;s<e.length;s++)if(!1===e[s])for(let e=0;e<3;e++)t.attributes.normal.array[3*s+e]=this.oldNormals[3*s+e]}return t}))}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/defineProperty"),e=require("three"),s=require("../BufferGeometryUtils-971dfde3.js");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}require("../types/helpers.cjs.js");var o=i(t);exports.EdgeSplitModifier=class{constructor(){o.default(this,"A",new e.Vector3),o.default(this,"B",new e.Vector3),o.default(this,"C",new e.Vector3),o.default(this,"positions",[]),o.default(this,"normals",new Float32Array),o.default(this,"indexes",[]),o.default(this,"pointToIndexMap",[]),o.default(this,"splitIndexes",[]),o.default(this,"oldNormals",[]),o.default(this,"computeNormals",(()=>{this.normals=new Float32Array(3*this.indexes.length);for(let t=0;t<this.indexes.length;t+=3){let e=this.indexes[t];this.A.set(this.positions[3*e],this.positions[3*e+1],this.positions[3*e+2]),e=this.indexes[t+1],this.B.set(this.positions[3*e],this.positions[3*e+1],this.positions[3*e+2]),e=this.indexes[t+2],this.C.set(this.positions[3*e],this.positions[3*e+1],this.positions[3*e+2]),this.C.sub(this.B),this.A.sub(this.B);const s=this.C.cross(this.A).normalize();for(let e=0;e<3;e++)this.normals[3*(t+e)]=s.x,this.normals[3*(t+e)+1]=s.y,this.normals[3*(t+e)+2]=s.z}})),o.default(this,"mapPositionsToIndexes",(()=>{this.pointToIndexMap=Array(this.positions.length/3);for(let t=0;t<this.indexes.length;t++){const e=this.indexes[t];null==this.pointToIndexMap[e]&&(this.pointToIndexMap[e]=[]),this.pointToIndexMap[e].push(t)}})),o.default(this,"edgeSplitToGroups",((t,e,s)=>{this.A.set(this.normals[3*s],this.normals[3*s+1],this.normals[3*s+2]).normalize();const i={splitGroup:[],currentGroup:[s]};for(let o of t)o!==s&&(this.B.set(this.normals[3*o],this.normals[3*o+1],this.normals[3*o+2]).normalize(),this.B.dot(this.A)<e?i.splitGroup.push(o):i.currentGroup.push(o));return i})),o.default(this,"edgeSplit",((t,e,s=null)=>{if(0===t.length)return;const i=[];for(let s of t)i.push(this.edgeSplitToGroups(t,e,s));let o=i[0];for(let t of i)t.currentGroup.length>o.currentGroup.length&&(o=t);null!=s&&this.splitIndexes.push({original:s,indexes:o.currentGroup}),o.splitGroup.length&&this.edgeSplit(o.splitGroup,e,s||o.currentGroup[0])})),o.default(this,"modify",((t,i,o=!0)=>{let r=!1;if(t.attributes.normal&&(r=!0,t=t.clone(),!0===o&&null!==t.index&&(this.oldNormals=t.attributes.normal.array),t.deleteAttribute("normal")),null==t.index){if(void 0===s.BufferGeometryUtils)throw"THREE.EdgeSplitModifier relies on BufferGeometryUtils";t=s.mergeVertices(t)}this.indexes=t.index.array,this.positions=t.getAttribute("position").array,this.computeNormals(),this.mapPositionsToIndexes(),this.splitIndexes=[];for(let t of this.pointToIndexMap)this.edgeSplit(t,Math.cos(i)-.001);const n={};for(let s of Object.keys(t.attributes)){const i=t.attributes[s],o=new i.array.constructor((this.indexes.length+this.splitIndexes.length)*i.itemSize);o.set(i.array),n[s]=new e.BufferAttribute(o,i.itemSize,i.normalized)}const l=new Uint32Array(this.indexes.length);l.set(this.indexes);for(let t=0;t<this.splitIndexes.length;t++){const e=this.splitIndexes[t],s=this.indexes[e.original];for(let e of Object.values(n))for(let i=0;i<e.itemSize;i++)e.array[(this.indexes.length+t)*e.itemSize+i]=e.array[s*e.itemSize+i];for(let s of e.indexes)l[s]=this.indexes.length+t}(t=new e.BufferGeometry).setIndex(new e.BufferAttribute(l,1));for(let e of Object.keys(n))t.setAttribute(e,n[e]);if(r&&(t.computeVertexNormals(),null!==this.oldNormals)){const e=new Array(this.oldNormals.length/3).fill(!1);for(let t of this.splitIndexes)e[t.original]=!0;for(let s=0;s<e.length;s++)if(!1===e[s])for(let e=0;e<3;e++)t.attributes.normal.array[3*s+e]=this.oldNormals[3*s+e]}return t}))}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three"),o=require("../BufferGeometryUtils-9eb5c2e7.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../types/helpers.cjs.js");var i=s(e);const r=new t.Vector3,h=new t.Vector3;function n(e,t){const o=e.indexOf(t);o>-1&&e.splice(o,1)}class l{constructor(e,t){i.default(this,"position",void 0),i.default(this,"id",void 0),i.default(this,"faces",void 0),i.default(this,"neighbors",void 0),i.default(this,"collapseCost",void 0),i.default(this,"collapseNeighbor",void 0),i.default(this,"minCost",0),i.default(this,"totalCost",0),i.default(this,"costCount",0),this.position=e,this.id=t,this.faces=[],this.neighbors=[],this.collapseCost=0,this.collapseNeighbor=null}addUniqueNeighbor(e){var t,o;t=this.neighbors,o=e,-1===t.indexOf(o)&&t.push(o)}removeIfNonNeighbor(e){const t=this.neighbors,o=this.faces,s=t.indexOf(e);if(-1!==s){for(let t=0;t<o.length;t++)if(o[t].hasVertex(e))return;t.splice(s,1)}}}class a{constructor(e,o,s,r,h,n){i.default(this,"a",void 0),i.default(this,"b",void 0),i.default(this,"c",void 0),i.default(this,"v1",void 0),i.default(this,"v2",void 0),i.default(this,"v3",void 0),i.default(this,"normal",new t.Vector3),this.a=r,this.b=h,this.c=n,this.v1=e,this.v2=o,this.v3=s,this.computeNormal(),e.faces.push(this),e.addUniqueNeighbor(o),e.addUniqueNeighbor(s),o.faces.push(this),o.addUniqueNeighbor(e),o.addUniqueNeighbor(s),s.faces.push(this),s.addUniqueNeighbor(e),s.addUniqueNeighbor(o)}computeNormal(){const e=this.v1.position,t=this.v2.position,o=this.v3.position;r.subVectors(o,t),h.subVectors(e,t),r.cross(h).normalize(),this.normal.copy(r)}hasVertex(e){return e===this.v1||e===this.v2||e===this.v3}replaceVertex(e,t){e===this.v1?this.v1=t:e===this.v2?this.v2=t:e===this.v3&&(this.v3=t),n(e.faces,this),t.faces.push(this),e.removeIfNonNeighbor(this.v1),this.v1.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v2),this.v2.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v3),this.v3.removeIfNonNeighbor(e),this.v1.addUniqueNeighbor(this.v2),this.v1.addUniqueNeighbor(this.v3),this.v2.addUniqueNeighbor(this.v1),this.v2.addUniqueNeighbor(this.v3),this.v3.addUniqueNeighbor(this.v1),this.v3.addUniqueNeighbor(this.v2),this.computeNormal()}}exports.SimplifyModifier=class{constructor(){i.default(this,"computeEdgeCollapseCost",((e,t)=>{const o=t.position.distanceTo(e.position);let s=0;const i=[];let r,h,n,l=e.faces.length;for(r=0;r<l;r++)h=e.faces[r],h.hasVertex(t)&&i.push(h);for(r=0;r<l;r++){let t=1;h=e.faces[r];for(let e=0;e<i.length;e++){n=i[e];const o=h.normal.dot(n.normal);t=Math.min(t,(1.001-o)/2)}s=Math.max(s,t)}i.length<2&&(s=1);return o*s+0})),i.default(this,"computeEdgeCostAtVertex",(e=>{if(0===e.neighbors.length)return e.collapseNeighbor=null,void(e.collapseCost=-.01);e.collapseCost=1e5,e.collapseNeighbor=null;for(let t=0;t<e.neighbors.length;t++){const o=this.computeEdgeCollapseCost(e,e.neighbors[t]);e.collapseNeighbor||(e.collapseNeighbor=e.neighbors[t],e.collapseCost=o,e.minCost=o,e.totalCost=0,e.costCount=0),e.costCount++,e.totalCost+=o,o<e.minCost&&(e.collapseNeighbor=e.neighbors[t],e.minCost=o)}e.collapseCost=e.totalCost/e.costCount})),i.default(this,"removeFace",((e,t)=>{n(t,e),e.v1&&n(e.v1.faces,e),e.v2&&n(e.v2.faces,e),e.v3&&n(e.v3.faces,e);const o=[e.v1,e.v2,e.v3];let s,i;for(let e=0;e<3;e++)s=o[e],i=o[(e+1)%3],s&&i&&(s.removeIfNonNeighbor(i),i.removeIfNonNeighbor(s))})),i.default(this,"collapse",((e,t,o,s)=>{if(!s)return void this.removeVertex(o,e);let i;const r=[];for(i=0;i<o.neighbors.length;i++)r.push(o.neighbors[i]);for(i=o.faces.length-1;i>=0;i--)o.faces[i].hasVertex(s)&&this.removeFace(o.faces[i],t);for(i=o.faces.length-1;i>=0;i--)o.faces[i].replaceVertex(o,s);for(this.removeVertex(o,e),i=0;i<r.length;i++)this.computeEdgeCostAtVertex(r[i])})),i.default(this,"minimumCostEdge",(e=>{let t=e[0];for(let o=0;o<e.length;o++)e[o].collapseCost<t.collapseCost&&(t=e[o]);return t})),i.default(this,"modify",((e,s)=>{const i=(e=e.clone()).attributes;for(let t in i)"position"!==t&&e.deleteAttribute(t);const r=[],h=[],n=(e=o.mergeVertices(e)).getAttribute("position");for(let e=0;e<n.count;e++){const o=(new t.Vector3).fromBufferAttribute(n,e),s=new l(o,e);r.push(s)}const c=e.getIndex();if(null!==c)for(let e=0;e<c.count;e+=3){const t=c.getX(e),o=c.getX(e+1),s=c.getX(e+2),i=new a(r[t],r[o],r[s],t,o,s);h.push(i)}else for(let e=0;e<n.count;e+=3){const t=e,o=e+1,s=e+2,i=new a(r[t],r[o],r[s],t,o,s);h.push(i)}for(let e=0,t=r.length;e<t;e++)this.computeEdgeCostAtVertex(r[e]);let f,u=s;for(;u--;){if(f=this.minimumCostEdge(r),!f){console.log("THREE.SimplifyModifier: No next vertex");break}this.collapse(r,h,f,f.collapseNeighbor)}const d=new t.BufferGeometry,v=[];let g=[];for(let e=0;e<r.length;e++){const t=r[e].position;v.push(t.x,t.y,t.z)}for(let e=0;e<h.length;e++){const t=h[e],o=r.indexOf(t.v1),s=r.indexOf(t.v2),i=r.indexOf(t.v3);g.push(o,s,i)}return d.setAttribute("position",new t.Float32BufferAttribute(v,3)),d.setIndex(g),d}))}removeVertex(e,t){for(console.assert(0===e.faces.length);e.neighbors.length;){n(e.neighbors.pop().neighbors,e)}n(t,e)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three"),o=require("../BufferGeometryUtils-971dfde3.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../types/helpers.cjs.js");var i=s(e);const r=new t.Vector3,h=new t.Vector3;function n(e,t){const o=e.indexOf(t);o>-1&&e.splice(o,1)}class l{constructor(e,t){i.default(this,"position",void 0),i.default(this,"id",void 0),i.default(this,"faces",void 0),i.default(this,"neighbors",void 0),i.default(this,"collapseCost",void 0),i.default(this,"collapseNeighbor",void 0),i.default(this,"minCost",0),i.default(this,"totalCost",0),i.default(this,"costCount",0),this.position=e,this.id=t,this.faces=[],this.neighbors=[],this.collapseCost=0,this.collapseNeighbor=null}addUniqueNeighbor(e){var t,o;t=this.neighbors,o=e,-1===t.indexOf(o)&&t.push(o)}removeIfNonNeighbor(e){const t=this.neighbors,o=this.faces,s=t.indexOf(e);if(-1!==s){for(let t=0;t<o.length;t++)if(o[t].hasVertex(e))return;t.splice(s,1)}}}class a{constructor(e,o,s,r,h,n){i.default(this,"a",void 0),i.default(this,"b",void 0),i.default(this,"c",void 0),i.default(this,"v1",void 0),i.default(this,"v2",void 0),i.default(this,"v3",void 0),i.default(this,"normal",new t.Vector3),this.a=r,this.b=h,this.c=n,this.v1=e,this.v2=o,this.v3=s,this.computeNormal(),e.faces.push(this),e.addUniqueNeighbor(o),e.addUniqueNeighbor(s),o.faces.push(this),o.addUniqueNeighbor(e),o.addUniqueNeighbor(s),s.faces.push(this),s.addUniqueNeighbor(e),s.addUniqueNeighbor(o)}computeNormal(){const e=this.v1.position,t=this.v2.position,o=this.v3.position;r.subVectors(o,t),h.subVectors(e,t),r.cross(h).normalize(),this.normal.copy(r)}hasVertex(e){return e===this.v1||e===this.v2||e===this.v3}replaceVertex(e,t){e===this.v1?this.v1=t:e===this.v2?this.v2=t:e===this.v3&&(this.v3=t),n(e.faces,this),t.faces.push(this),e.removeIfNonNeighbor(this.v1),this.v1.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v2),this.v2.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v3),this.v3.removeIfNonNeighbor(e),this.v1.addUniqueNeighbor(this.v2),this.v1.addUniqueNeighbor(this.v3),this.v2.addUniqueNeighbor(this.v1),this.v2.addUniqueNeighbor(this.v3),this.v3.addUniqueNeighbor(this.v1),this.v3.addUniqueNeighbor(this.v2),this.computeNormal()}}exports.SimplifyModifier=class{constructor(){i.default(this,"computeEdgeCollapseCost",((e,t)=>{const o=t.position.distanceTo(e.position);let s=0;const i=[];let r,h,n,l=e.faces.length;for(r=0;r<l;r++)h=e.faces[r],h.hasVertex(t)&&i.push(h);for(r=0;r<l;r++){let t=1;h=e.faces[r];for(let e=0;e<i.length;e++){n=i[e];const o=h.normal.dot(n.normal);t=Math.min(t,(1.001-o)/2)}s=Math.max(s,t)}i.length<2&&(s=1);return o*s+0})),i.default(this,"computeEdgeCostAtVertex",(e=>{if(0===e.neighbors.length)return e.collapseNeighbor=null,void(e.collapseCost=-.01);e.collapseCost=1e5,e.collapseNeighbor=null;for(let t=0;t<e.neighbors.length;t++){const o=this.computeEdgeCollapseCost(e,e.neighbors[t]);e.collapseNeighbor||(e.collapseNeighbor=e.neighbors[t],e.collapseCost=o,e.minCost=o,e.totalCost=0,e.costCount=0),e.costCount++,e.totalCost+=o,o<e.minCost&&(e.collapseNeighbor=e.neighbors[t],e.minCost=o)}e.collapseCost=e.totalCost/e.costCount})),i.default(this,"removeFace",((e,t)=>{n(t,e),e.v1&&n(e.v1.faces,e),e.v2&&n(e.v2.faces,e),e.v3&&n(e.v3.faces,e);const o=[e.v1,e.v2,e.v3];let s,i;for(let e=0;e<3;e++)s=o[e],i=o[(e+1)%3],s&&i&&(s.removeIfNonNeighbor(i),i.removeIfNonNeighbor(s))})),i.default(this,"collapse",((e,t,o,s)=>{if(!s)return void this.removeVertex(o,e);let i;const r=[];for(i=0;i<o.neighbors.length;i++)r.push(o.neighbors[i]);for(i=o.faces.length-1;i>=0;i--)o.faces[i].hasVertex(s)&&this.removeFace(o.faces[i],t);for(i=o.faces.length-1;i>=0;i--)o.faces[i].replaceVertex(o,s);for(this.removeVertex(o,e),i=0;i<r.length;i++)this.computeEdgeCostAtVertex(r[i])})),i.default(this,"minimumCostEdge",(e=>{let t=e[0];for(let o=0;o<e.length;o++)e[o].collapseCost<t.collapseCost&&(t=e[o]);return t})),i.default(this,"modify",((e,s)=>{const i=(e=e.clone()).attributes;for(let t in i)"position"!==t&&e.deleteAttribute(t);const r=[],h=[],n=(e=o.mergeVertices(e)).getAttribute("position");for(let e=0;e<n.count;e++){const o=(new t.Vector3).fromBufferAttribute(n,e),s=new l(o,e);r.push(s)}const c=e.getIndex();if(null!==c)for(let e=0;e<c.count;e+=3){const t=c.getX(e),o=c.getX(e+1),s=c.getX(e+2),i=new a(r[t],r[o],r[s],t,o,s);h.push(i)}else for(let e=0;e<n.count;e+=3){const t=e,o=e+1,s=e+2,i=new a(r[t],r[o],r[s],t,o,s);h.push(i)}for(let e=0,t=r.length;e<t;e++)this.computeEdgeCostAtVertex(r[e]);let f,u=s;for(;u--;){if(f=this.minimumCostEdge(r),!f){console.log("THREE.SimplifyModifier: No next vertex");break}this.collapse(r,h,f,f.collapseNeighbor)}const d=new t.BufferGeometry,v=[];let g=[];for(let e=0;e<r.length;e++){const t=r[e].position;v.push(t.x,t.y,t.z)}for(let e=0;e<h.length;e++){const t=h[e],o=r.indexOf(t.v1),s=r.indexOf(t.v2),i=r.indexOf(t.v3);g.push(o,s,i)}return d.setAttribute("position",new t.Float32BufferAttribute(v,3)),d.setIndex(g),d}))}removeVertex(e,t){for(console.assert(0===e.faces.length);e.neighbors.length;){n(e.neighbors.pop().neighbors,e)}n(t,e)}};
@@ -1,10 +1,10 @@
1
- import { Color } from 'three';
1
+ import { Color, ColorRepresentation } from 'three';
2
2
 
3
3
  import { InputNode } from '../core/InputNode';
4
4
  import { NodeBuilder } from '../core/NodeBuilder';
5
5
 
6
6
  export class ColorNode extends InputNode {
7
- constructor(color: Color | number | string, g?: number, b?: number);
7
+ constructor(color: ColorRepresentation, g?: number, b?: number);
8
8
 
9
9
  value: Color;
10
10
  nodeType: string;
@@ -4,12 +4,13 @@ import { InputNode } from '../core/InputNode';
4
4
  import { NodeBuilder } from '../core/NodeBuilder';
5
5
  import { Node } from '../core/Node';
6
6
  import { UVNode } from '../accessors/UVNode';
7
+ import { UVTransformNode } from '../utils/UVTransformNode';
7
8
 
8
9
  export class TextureNode extends InputNode {
9
- constructor(value: Texture, uv?: UVNode, bias?: Node, project?: boolean);
10
+ constructor(value: Texture, uv?: UVNode | UVTransformNode, bias?: Node, project?: boolean);
10
11
 
11
12
  value: Texture;
12
- uv: UVNode;
13
+ uv: UVNode | UVTransformNode;
13
14
  bias: Node;
14
15
  project: boolean;
15
16
  nodeType: string;
@@ -21,5 +21,5 @@ export class StandardNodeMaterial extends NodeMaterial {
21
21
  environment: Node;
22
22
  mask: Node;
23
23
  position: Node;
24
- sheen: Node;
24
+ sheenColor: Node;
25
25
  }
@@ -8,6 +8,7 @@ export class StandardNode extends Node {
8
8
  roughness: Node;
9
9
  metalness: Node;
10
10
  nodeType: string;
11
+ sheenColor: Node;
11
12
 
12
13
  build(builder: NodeBuilder): string;
13
14
  copy(source: StandardNode): this;
@@ -10,7 +10,7 @@ export class ColorSpaceNode extends TempNode {
10
10
  nodeType: string;
11
11
 
12
12
  fromEncoding(encoding: number): void;
13
- fromDecoding(encoding: number): void;
13
+ fromDecoding(): void;
14
14
  copy(source: ColorSpaceNode): this;
15
15
 
16
16
  static Nodes: {
@@ -1,4 +1,5 @@
1
1
  import { TempNode } from '../core/TempNode';
2
+ import { Node } from '../core/Node';
2
3
 
3
4
  export class JoinNode extends TempNode {
4
5
  constructor(x: Node, y: Node, z?: Node, w?: Node);
@@ -1,7 +1,13 @@
1
- import { BufferGeometry, Material, ImmediateRenderObject } from 'three';
1
+ import { BufferGeometry, Material, Mesh, Color } from 'three';
2
2
 
3
- export class MarchingCubes extends ImmediateRenderObject {
4
- constructor(resolution: number, material: Material, enableUvs?: boolean, enableColors?: boolean);
3
+ export class MarchingCubes extends Mesh {
4
+ constructor(
5
+ resolution: number,
6
+ material: Material,
7
+ enableUvs?: boolean,
8
+ enableColors?: boolean,
9
+ maxPolyCount?: number,
10
+ );
5
11
 
6
12
  enableUvs: boolean;
7
13
  enableColors: boolean;
@@ -46,7 +52,9 @@ export class MarchingCubes extends ImmediateRenderObject {
46
52
  begin(): void;
47
53
  end(): void;
48
54
 
49
- addBall(ballx: number, bally: number, ballz: number, strength: number, subtract: number, colors: any): void;
55
+ init(resolution: number): void;
56
+
57
+ addBall(ballx: number, bally: number, ballz: number, strength: number, subtract: number, colors?: Color): void;
50
58
 
51
59
  addPlaneX(strength: number, subtract: number): void;
52
60
  addPlaneY(strength: number, subtract: number): void;
@@ -1,7 +1,7 @@
1
- import { Mesh, BufferGeometry, Color, TextureEncoding, WebGLRenderTarget } from 'three';
1
+ import { Mesh, BufferGeometry, ColorRepresentation, TextureEncoding, WebGLRenderTarget } from 'three';
2
2
 
3
3
  export interface ReflectorOptions {
4
- color?: Color;
4
+ color?: ColorRepresentation;
5
5
  textureWidth?: number;
6
6
  textureHeight?: number;
7
7
  clipBias?: number;
@@ -13,4 +13,6 @@ export class Reflector extends Mesh {
13
13
  constructor(geometry?: BufferGeometry, options?: ReflectorOptions);
14
14
 
15
15
  getRenderTarget(): WebGLRenderTarget;
16
+
17
+ dispose(): void;
16
18
  }
@@ -22,12 +22,12 @@ export interface ReflectorShader {
22
22
  }
23
23
 
24
24
  export interface ReflectorOptions {
25
- clipBias?: number;
26
- textureWidth?: number;
27
- textureHeight?: number;
28
- color?: number;
29
- useDepthTexture?: boolean;
30
- shader?: ReflectorShader;
25
+ clipBias?: number | undefined;
26
+ textureWidth?: number | undefined;
27
+ textureHeight?: number | undefined;
28
+ color?: number | undefined;
29
+ useDepthTexture?: boolean | undefined;
30
+ shader?: ReflectorShader | undefined;
31
31
  }
32
32
 
33
33
  export class Reflector<TGeometry extends BufferGeometry = BufferGeometry> extends Mesh<TGeometry> {
@@ -1,7 +1,7 @@
1
- import { Mesh, BufferGeometry, Color, TextureEncoding, WebGLRenderTarget } from 'three';
1
+ import { Mesh, BufferGeometry, ColorRepresentation, TextureEncoding, WebGLRenderTarget } from 'three';
2
2
 
3
3
  export interface RefractorOptions {
4
- color?: Color;
4
+ color?: ColorRepresentation;
5
5
  textureWidth?: number;
6
6
  textureHeight?: number;
7
7
  clipBias?: number;
@@ -13,4 +13,6 @@ export class Refractor extends Mesh {
13
13
  constructor(geometry?: BufferGeometry, options?: RefractorOptions);
14
14
 
15
15
  getRenderTarget(): WebGLRenderTarget;
16
+
17
+ dispose(): void;
16
18
  }
@@ -1,4 +1,4 @@
1
- import { BufferGeometry, Color, Mesh, Side, Texture, Vector3 } from 'three';
1
+ import { BufferGeometry, ColorRepresentation, Mesh, ShaderMaterial, Side, Texture, Vector3 } from 'three';
2
2
 
3
3
  export interface WaterOptions {
4
4
  textureWidth?: number;
@@ -8,8 +8,8 @@ export interface WaterOptions {
8
8
  time?: number;
9
9
  waterNormals?: Texture;
10
10
  sunDirection?: Vector3;
11
- sunColor?: Color | string | number;
12
- waterColor?: Color | string | number;
11
+ sunColor?: ColorRepresentation;
12
+ waterColor?: ColorRepresentation;
13
13
  eye?: Vector3;
14
14
  distortionScale?: number;
15
15
  side?: Side;
@@ -17,5 +17,6 @@ export interface WaterOptions {
17
17
  }
18
18
 
19
19
  export class Water extends Mesh {
20
+ material: ShaderMaterial;
20
21
  constructor(geometry: BufferGeometry, options: WaterOptions);
21
22
  }
@@ -1,7 +1,15 @@
1
- import { BufferGeometry, Color, Mesh, Texture, TextureEncoding, Vector2 } from 'three';
1
+ import {
2
+ BufferGeometry,
3
+ ColorRepresentation,
4
+ Mesh,
5
+ ShaderMaterial,
6
+ Texture,
7
+ TextureEncoding,
8
+ Vector2,
9
+ } from 'three';
2
10
 
3
11
  export interface Water2Options {
4
- color?: Color | string | number;
12
+ color?: ColorRepresentation;
5
13
  textureWidth?: number;
6
14
  textureHeight?: number;
7
15
  clipBias?: number;
@@ -16,6 +24,7 @@ export interface Water2Options {
16
24
  encoding?: TextureEncoding;
17
25
  }
18
26
 
19
- export class Water2 extends Mesh {
27
+ export class Water extends Mesh {
28
+ material: ShaderMaterial;
20
29
  constructor(geometry: BufferGeometry, options: Water2Options);
21
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-stdlib",
3
- "version": "2.8.1",
3
+ "version": "2.8.5",
4
4
  "private": false,
5
5
  "description": "stand-alone library of threejs examples",
6
6
  "main": "index.cjs.js",
@@ -22,7 +22,6 @@
22
22
  "dependencies": {
23
23
  "@babel/runtime": "^7.16.7",
24
24
  "@webgpu/glslang": "^0.0.15",
25
- "@webxr-input-profiles/motion-controllers": "^1.0.0",
26
25
  "chevrotain": "^9.0.2",
27
26
  "draco3d": "^1.4.1",
28
27
  "fflate": "^0.6.9",
@@ -33,6 +32,6 @@
33
32
  "zstddec": "^0.0.2"
34
33
  },
35
34
  "peerDependencies": {
36
- "three": ">=0.128.0"
35
+ "three": ">=0.137.0"
37
36
  }
38
37
  }
@@ -1,9 +1,9 @@
1
- import { Color } from 'three';
1
+ import { ColorRepresentation } from 'three';
2
2
 
3
3
  import { Pass } from './Pass';
4
4
 
5
5
  export class ClearPass extends Pass {
6
- constructor(clearColor?: Color | string | number, clearAlpha?: number);
7
- clearColor: Color | string | number;
6
+ constructor(clearColor?: ColorRepresentation, clearAlpha?: number);
7
+ clearColor: ColorRepresentation;
8
8
  clearAlpha: number;
9
9
  }
@@ -9,6 +9,7 @@ import {
9
9
  Vector2,
10
10
  WebGLRenderer,
11
11
  WebGLRenderTarget,
12
+ ColorRepresentation,
12
13
  } from 'three';
13
14
 
14
15
  import { Pass } from './Pass';
@@ -65,14 +66,14 @@ export class SAOPass extends Pass {
65
66
  renderer: WebGLRenderer,
66
67
  passMaterial: Material,
67
68
  renderTarget: WebGLRenderTarget,
68
- clearColor?: Color | string | number,
69
+ clearColor?: ColorRepresentation,
69
70
  clearAlpha?: number,
70
71
  ): void;
71
72
  renderOverride(
72
73
  renderer: WebGLRenderer,
73
74
  overrideMaterial: Material,
74
75
  renderTarget: WebGLRenderTarget,
75
- clearColor?: Color | string | number,
76
+ clearColor?: ColorRepresentation,
76
77
  clearAlpha?: number,
77
78
  ): void;
78
79
  }
@@ -1,14 +1,14 @@
1
- import { Scene, Camera, Color, ShaderMaterial, WebGLRenderTarget } from 'three';
1
+ import { Scene, Camera, ColorRepresentation, ShaderMaterial, WebGLRenderTarget } from 'three';
2
2
 
3
3
  import { Pass } from './Pass';
4
4
 
5
5
  export class SSAARenderPass extends Pass {
6
- constructor(scene: Scene, camera: Camera, clearColor: Color | string | number, clearAlpha: number);
6
+ constructor(scene: Scene, camera: Camera, clearColor: ColorRepresentation, clearAlpha: number);
7
7
  scene: Scene;
8
8
  camera: Camera;
9
9
  sampleLevel: number;
10
10
  unbiased: boolean;
11
- clearColor: Color | string | number;
11
+ clearColor: ColorRepresentation;
12
12
  clearAlpha: number;
13
13
  copyUniforms: object;
14
14
  copyMaterial: ShaderMaterial;
@@ -9,6 +9,7 @@ import {
9
9
  Vector3,
10
10
  WebGLRenderer,
11
11
  WebGLRenderTarget,
12
+ ColorRepresentation,
12
13
  } from 'three';
13
14
 
14
15
  import { Pass } from './Pass';
@@ -57,14 +58,14 @@ export class SSAOPass extends Pass {
57
58
  renderer: WebGLRenderer,
58
59
  passMaterial: Material,
59
60
  renderTarget: WebGLRenderTarget,
60
- clearColor?: Color | string | number,
61
+ clearColor?: ColorRepresentation,
61
62
  clearAlpha?: number,
62
63
  ): void;
63
64
  renderOverride(
64
65
  renderer: WebGLRenderer,
65
66
  overrideMaterial: Material,
66
67
  renderTarget: WebGLRenderTarget,
67
- clearColor?: Color | string | number,
68
+ clearColor?: ColorRepresentation,
68
69
  clearAlpha?: number,
69
70
  ): void;
70
71
  }
@@ -7,24 +7,22 @@ import {
7
7
  Scene,
8
8
  WebGLRenderer,
9
9
  Camera,
10
- TextureEncoding,
11
10
  Mesh,
12
11
  Material,
12
+ ColorRepresentation,
13
13
  } from 'three';
14
- import { Pass } from '../postprocessing/Pass';
14
+ import { Pass, FullScreenQuad } from '../postprocessing/Pass';
15
15
  import { Reflector } from '../objects/ReflectorForSSRPass';
16
16
 
17
17
  export interface SSRPassParams {
18
18
  renderer: WebGLRenderer;
19
19
  scene: Scene;
20
20
  camera: Camera;
21
- width?: number;
22
- height?: number;
21
+ width?: number | undefined;
22
+ height?: number | undefined;
23
23
  selects: Mesh[] | null;
24
- encoding: TextureEncoding;
25
- isPerspectiveCamera?: boolean;
26
- isBouncing?: boolean;
27
- morphTargets?: boolean;
24
+ isPerspectiveCamera?: boolean | undefined;
25
+ isBouncing?: boolean | undefined;
28
26
  groundReflector: Reflector | null;
29
27
  }
30
28
 
@@ -39,8 +37,7 @@ export class SSRPass extends Pass {
39
37
  opacity: number;
40
38
  output: number;
41
39
  maxDistance: number;
42
- surfDist: number;
43
- encoding: TextureEncoding;
40
+ thickness: number;
44
41
  tempColor: Color;
45
42
 
46
43
  get selects(): Mesh[] | null;
@@ -84,7 +81,7 @@ export class SSRPass extends Pass {
84
81
 
85
82
  copyMaterial: ShaderMaterial;
86
83
 
87
- fsQuad: Pass.FullScreenQuad;
84
+ fsQuad: FullScreenQuad;
88
85
 
89
86
  originalClearColor: Color;
90
87
 
@@ -105,23 +102,23 @@ export class SSRPass extends Pass {
105
102
  renderer: WebGLRenderer,
106
103
  passMaterial: Material,
107
104
  renderTarget: WebGLRenderTarget,
108
- clearColor: Color | string | number,
109
- clearAlpha: Color | string | number,
105
+ clearColor: ColorRepresentation,
106
+ clearAlpha: ColorRepresentation,
110
107
  ) => void;
111
108
 
112
109
  renderOverride: (
113
110
  renderer: WebGLRenderer,
114
111
  passMaterial: Material,
115
112
  renderTarget: WebGLRenderTarget,
116
- clearColor: Color | string | number,
117
- clearAlpha: Color | string | number,
113
+ clearColor: ColorRepresentation,
114
+ clearAlpha: ColorRepresentation,
118
115
  ) => void;
119
116
 
120
117
  renderMetalness: (
121
118
  renderer: WebGLRenderer,
122
119
  passMaterial: Material,
123
120
  renderTarget: WebGLRenderTarget,
124
- clearColor: Color | string | number,
125
- clearAlpha: Color | string | number,
121
+ clearColor: ColorRepresentation,
122
+ clearAlpha: ColorRepresentation,
126
123
  ) => void;
127
124
  }
@@ -1,8 +1,8 @@
1
- import { Scene, Camera, Color } from 'three';
1
+ import { Scene, Camera, ColorRepresentation } from 'three';
2
2
 
3
3
  import { SSAARenderPass } from './SSAARenderPass';
4
4
 
5
5
  export class TAARenderPass extends SSAARenderPass {
6
- constructor(scene: Scene, camera: Camera, clearColor: Color | string | number, clearAlpha: number);
6
+ constructor(scene: Scene, camera: Camera, clearColor: ColorRepresentation, clearAlpha: number);
7
7
  accumulate: boolean;
8
8
  }
@@ -8,8 +8,12 @@ export class CSS2DObject extends Object3D {
8
8
  onAfterRender: (renderer: unknown, scene: Scene, camera: Camera) => void;
9
9
  }
10
10
 
11
+ export type CSS2DParameters = {
12
+ element?: HTMLElement;
13
+ };
14
+
11
15
  export class CSS2DRenderer {
12
- constructor();
16
+ constructor(parameters?: CSS2DParameters);
13
17
  domElement: HTMLElement;
14
18
 
15
19
  getSize(): { width: number; height: number };
@@ -12,8 +12,12 @@ export class CSS3DSprite extends CSS3DObject {
12
12
  constructor(element: HTMLElement);
13
13
  }
14
14
 
15
+ export type CSS3DParameters = {
16
+ element?: HTMLElement;
17
+ };
18
+
15
19
  export class CSS3DRenderer {
16
- constructor();
20
+ constructor(parameters?: CSS3DParameters);
17
21
  domElement: HTMLElement;
18
22
 
19
23
  getSize(): { width: number; height: number };
@@ -365,47 +365,68 @@ class WebGPUTextures {
365
365
 
366
366
  _getBlockData(format) {
367
367
  // this method is only relevant for compressed texture formats
368
- if (format === GPUTextureFormat.BC1RGBAUnorm || format === GPUTextureFormat.BC1RGBAUnormSRGB) return {
369
- byteLength: 8,
370
- width: 4,
371
- height: 4
372
- }; // DXT1
373
-
374
- if (format === GPUTextureFormat.BC2RGBAUnorm || format === GPUTextureFormat.BC2RGBAUnormSRGB) return {
375
- byteLength: 16,
376
- width: 4,
377
- height: 4
378
- }; // DXT3
379
-
380
- if (format === GPUTextureFormat.BC3RGBAUnorm || format === GPUTextureFormat.BC3RGBAUnormSRGB) return {
381
- byteLength: 16,
382
- width: 4,
383
- height: 4
384
- }; // DXT5
385
-
386
- if (format === GPUTextureFormat.BC4RUnorm || format === GPUTextureFormat.BC4RSNorm) return {
387
- byteLength: 8,
388
- width: 4,
389
- height: 4
390
- }; // RGTC1
391
-
392
- if (format === GPUTextureFormat.BC5RGUnorm || format === GPUTextureFormat.BC5RGSnorm) return {
393
- byteLength: 16,
394
- width: 4,
395
- height: 4
396
- }; // RGTC2
397
-
398
- if (format === GPUTextureFormat.BC6HRGBUFloat || format === GPUTextureFormat.BC6HRGBFloat) return {
399
- byteLength: 16,
400
- width: 4,
401
- height: 4
402
- }; // BPTC (float)
403
-
404
- if (format === GPUTextureFormat.BC7RGBAUnorm || format === GPUTextureFormat.BC7RGBAUnormSRGB) return {
405
- byteLength: 16,
406
- width: 4,
407
- height: 4
408
- }; // BPTC (unorm)
368
+ if (format === GPUTextureFormat.BC1RGBAUnorm || format === GPUTextureFormat.BC1RGBAUnormSRGB) {
369
+ return {
370
+ byteLength: 8,
371
+ width: 4,
372
+ height: 4
373
+ };
374
+ } // DXT1
375
+
376
+
377
+ if (format === GPUTextureFormat.BC2RGBAUnorm || format === GPUTextureFormat.BC2RGBAUnormSRGB) {
378
+ return {
379
+ byteLength: 16,
380
+ width: 4,
381
+ height: 4
382
+ };
383
+ } // DXT3
384
+
385
+
386
+ if (format === GPUTextureFormat.BC3RGBAUnorm || format === GPUTextureFormat.BC3RGBAUnormSRGB) {
387
+ return {
388
+ byteLength: 16,
389
+ width: 4,
390
+ height: 4
391
+ };
392
+ } // DXT5
393
+
394
+
395
+ if (format === GPUTextureFormat.BC4RUnorm || format === GPUTextureFormat.BC4RSNorm) {
396
+ return {
397
+ byteLength: 8,
398
+ width: 4,
399
+ height: 4
400
+ };
401
+ } // RGTC1
402
+
403
+
404
+ if (format === GPUTextureFormat.BC5RGUnorm || format === GPUTextureFormat.BC5RGSnorm) {
405
+ return {
406
+ byteLength: 16,
407
+ width: 4,
408
+ height: 4
409
+ };
410
+ } // RGTC2
411
+
412
+
413
+ if (format === GPUTextureFormat.BC6HRGBUFloat || format === GPUTextureFormat.BC6HRGBFloat) {
414
+ return {
415
+ byteLength: 16,
416
+ width: 4,
417
+ height: 4
418
+ };
419
+ } // BPTC (float)
420
+
421
+
422
+ if (format === GPUTextureFormat.BC7RGBAUnorm || format === GPUTextureFormat.BC7RGBAUnormSRGB) {
423
+ return {
424
+ byteLength: 16,
425
+ width: 4,
426
+ height: 4
427
+ };
428
+ } // BPTC (unorm)
429
+
409
430
  }
410
431
 
411
432
  _getBytesPerTexel(format) {
@@ -27,8 +27,7 @@ export interface SSRShader {
27
27
  opacity: IUniform<number>;
28
28
  maxDistance: IUniform<number>;
29
29
  cameraRange: IUniform<number>;
30
- surfDist: IUniform<number>;
31
- thickTolerance: IUniform<number>;
30
+ thickness: IUniform<number>;
32
31
  };
33
32
  vertexShader: string;
34
33
  fragmentShader: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("three"),require("../types/helpers.cjs.js");var e=require("../BufferGeometryUtils-9eb5c2e7.js");exports.computeMorphedAttributes=e.computeMorphedAttributes,exports.estimateBytesUsed=e.estimateBytesUsed,exports.interleaveAttributes=e.interleaveAttributes,exports.mergeBufferAttributes=e.mergeBufferAttributes,exports.mergeBufferGeometries=e.mergeBufferGeometries,exports.mergeVertices=e.mergeVertices,exports.toTrianglesDrawMode=e.toTrianglesDrawMode;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("three"),require("../types/helpers.cjs.js");var e=require("../BufferGeometryUtils-971dfde3.js");exports.computeMorphedAttributes=e.computeMorphedAttributes,exports.estimateBytesUsed=e.estimateBytesUsed,exports.interleaveAttributes=e.interleaveAttributes,exports.mergeBufferAttributes=e.mergeBufferAttributes,exports.mergeBufferGeometries=e.mergeBufferGeometries,exports.mergeVertices=e.mergeVertices,exports.toTrianglesDrawMode=e.toTrianglesDrawMode;
@@ -485,7 +485,8 @@ function computeMorphedAttributes(object) {
485
485
 
486
486
  const morphInfluences = object.morphTargetInfluences;
487
487
 
488
- if (material.morphTargets && morphAttribute && morphInfluences) {
488
+ if ( // @ts-expect-error
489
+ material.morphTargets && morphAttribute && morphInfluences) {
489
490
  _morphA.set(0, 0, 0);
490
491
 
491
492
  _morphB.set(0, 0, 0);