@vincentt-xr/sdk 2.0.0-alpha.8 → 2.0.0-alpha.9

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 (517) hide show
  1. package/GROUNDING.md +4643 -170
  2. package/README.md +1 -0
  3. package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
  4. package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
  5. package/dist/DebuggerUI-7ngnJsBe.js +275 -0
  6. package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
  7. package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
  8. package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
  9. package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
  10. package/dist/FaceSurface-DmP9AEeC.js +27 -0
  11. package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
  12. package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
  13. package/dist/SkeletonUtils-C2r90MtN.js +21 -0
  14. package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
  15. package/dist/TextLabel-XE0rQSDn.cjs +2 -0
  16. package/dist/TextLabel-c9BCucOI.js +961 -0
  17. package/dist/assets/gltfLoader.d.ts +16 -0
  18. package/dist/assets/loaders.d.ts +16 -1
  19. package/dist/body-pose/index.d.ts +521 -0
  20. package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
  21. package/dist/body-trigger/frame.d.ts +88 -0
  22. package/dist/body-trigger/index.d.ts +6 -0
  23. package/dist/body-trigger/moves.d.ts +235 -0
  24. package/dist/body-trigger/trigger.d.ts +75 -0
  25. package/dist/calibration/calibration.d.ts +11 -6
  26. package/dist/canonicalFace-BHwyCx1c.js +9 -0
  27. package/dist/canonicalFace-C83I225R.cjs +1 -0
  28. package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
  29. package/dist/components/BodyInstruction/index.d.ts +69 -0
  30. package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
  31. package/dist/components/BodyTracker/index.d.ts +10 -2
  32. package/dist/components/BodyTrigger/index.d.ts +49 -0
  33. package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
  34. package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
  35. package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
  36. package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
  37. package/dist/components/FaceAtlas/constants.d.ts +8 -0
  38. package/dist/components/FaceAtlas/index.d.ts +7 -0
  39. package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
  40. package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
  41. package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
  42. package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
  43. package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
  44. package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
  45. package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
  46. package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
  47. package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
  48. package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
  49. package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
  50. package/dist/components/FaceCharacter/index.d.ts +18 -0
  51. package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
  52. package/dist/components/FaceInset/FaceInset.d.ts +68 -0
  53. package/dist/components/FaceInset/frame.d.ts +94 -0
  54. package/dist/components/FaceInset/index.d.ts +6 -0
  55. package/dist/components/FaceInset/material.d.ts +40 -0
  56. package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
  57. package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
  58. package/dist/components/FaceInstruction/index.d.ts +56 -0
  59. package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
  60. package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
  61. package/dist/components/FaceLiquify/debug.d.ts +37 -0
  62. package/dist/components/FaceLiquify/frame.d.ts +55 -0
  63. package/dist/components/FaceLiquify/index.d.ts +10 -0
  64. package/dist/components/FaceLiquify/material.d.ts +39 -0
  65. package/dist/components/FaceLiquify/pass.d.ts +49 -0
  66. package/dist/components/FaceLiquify/presence.d.ts +25 -0
  67. package/dist/components/FaceLiquify/presets.d.ts +82 -0
  68. package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
  69. package/dist/components/FaceLiquify/target.d.ts +85 -0
  70. package/dist/components/FaceLiquify/warp.d.ts +72 -0
  71. package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +5 -3
  72. package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
  73. package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +9 -0
  74. package/dist/components/FaceMesh/index.d.ts +1 -1
  75. package/dist/components/FaceRetouch/Background.d.ts +3 -1
  76. package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
  77. package/dist/components/FaceRetouch/renderState.d.ts +19 -0
  78. package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
  79. package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
  80. package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
  81. package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
  82. package/dist/components/FaceSwap/index.d.ts +13 -0
  83. package/dist/components/FaceSwap/settings.d.ts +300 -0
  84. package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
  85. package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
  86. package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
  87. package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
  88. package/dist/components/FaceWarp3D/index.d.ts +2 -3
  89. package/dist/components/Faceless/Faceless.d.ts +51 -0
  90. package/dist/components/Faceless/index.d.ts +2 -0
  91. package/dist/components/HairLock/HairLock.d.ts +39 -0
  92. package/dist/components/HairLock/index.d.ts +2 -0
  93. package/dist/components/HairLock/lockGeometry.d.ts +15 -0
  94. package/dist/components/HandCutout/index.d.ts +35 -0
  95. package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
  96. package/dist/components/HandInstruction/index.d.ts +74 -0
  97. package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
  98. package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
  99. package/dist/components/HandRig/HandAttachment.d.ts +34 -0
  100. package/dist/components/HandRig/HandOccluder.d.ts +55 -0
  101. package/dist/components/HandRig/HandTattoo.d.ts +61 -0
  102. package/dist/components/HandRig/WristAttachment.d.ts +34 -0
  103. package/dist/components/HandRig/index.d.ts +101 -0
  104. package/dist/components/HandRig/useArmMask.d.ts +29 -0
  105. package/dist/components/HandRig/wristSolve.d.ts +69 -0
  106. package/dist/components/HandTouch/HandTouch.d.ts +62 -0
  107. package/dist/components/HandTouch/Touchable.d.ts +36 -0
  108. package/dist/components/HandTouch/index.d.ts +2 -0
  109. package/dist/components/HeadBinding/index.d.ts +14 -0
  110. package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
  111. package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
  112. package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
  113. package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
  114. package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
  115. package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
  116. package/dist/components/HeadOccluder/index.d.ts +57 -3
  117. package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
  118. package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
  119. package/dist/components/Instruction/HintStage.d.ts +29 -0
  120. package/dist/components/Instruction/InstructionCue.d.ts +126 -0
  121. package/dist/components/Instruction/gestureHold.d.ts +20 -0
  122. package/dist/components/Instruction/ghost.d.ts +129 -0
  123. package/dist/components/Instruction/hintBlend.d.ts +19 -0
  124. package/dist/components/Instruction/hintLook.d.ts +81 -0
  125. package/dist/components/Instruction/hintLoop.d.ts +36 -0
  126. package/dist/components/Instruction/index.d.ts +41 -0
  127. package/dist/components/Instruction/useGhostModel.d.ts +33 -0
  128. package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
  129. package/dist/components/LipEffect/LipEffect.d.ts +22 -2
  130. package/dist/components/LipEffect/LipEffectMaterial.d.ts +62 -10
  131. package/dist/components/LipEffect/LipEffects.d.ts +5 -2
  132. package/dist/components/LipEffect/defaults.d.ts +21 -2
  133. package/dist/components/LipEffect/index.d.ts +1 -1
  134. package/dist/components/LipEffect/lipShading.d.ts +73 -0
  135. package/dist/components/LipEffect/settings.d.ts +117 -13
  136. package/dist/components/LipEffect/shader.d.ts +39 -0
  137. package/dist/components/LipEffect/types.d.ts +82 -10
  138. package/dist/components/LipEffect/useLipDesignTextures.d.ts +6 -0
  139. package/dist/components/LipEffect/uvGuide.d.ts +31 -16
  140. package/dist/components/Makeup/Blush.d.ts +18 -0
  141. package/dist/components/Makeup/Brows.d.ts +20 -0
  142. package/dist/components/Makeup/Contour.d.ts +17 -0
  143. package/dist/components/Makeup/Eyeliner.d.ts +20 -0
  144. package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
  145. package/dist/components/Makeup/Highlighter.d.ts +18 -0
  146. package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
  147. package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
  148. package/dist/components/Makeup/constants.d.ts +44 -0
  149. package/dist/components/Makeup/design.d.ts +106 -0
  150. package/dist/components/Makeup/designSamples.d.ts +42 -0
  151. package/dist/components/Makeup/eyes.d.ts +114 -0
  152. package/dist/components/Makeup/fields.d.ts +10 -0
  153. package/dist/components/Makeup/geometry.d.ts +106 -0
  154. package/dist/components/Makeup/index.d.ts +26 -0
  155. package/dist/components/Makeup/looks.d.ts +28 -0
  156. package/dist/components/Makeup/material.d.ts +239 -0
  157. package/dist/components/Makeup/settings.d.ts +54 -0
  158. package/dist/components/Makeup/shades.d.ts +143 -0
  159. package/dist/components/Makeup/shapes.d.ts +27 -0
  160. package/dist/components/Makeup/skinTone.d.ts +135 -0
  161. package/dist/components/Makeup/types.d.ts +110 -0
  162. package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
  163. package/dist/components/Necklace/Necklace.d.ts +44 -0
  164. package/dist/components/Necklace/index.d.ts +1 -0
  165. package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
  166. package/dist/components/ParticleEmitter/index.d.ts +1 -0
  167. package/dist/components/ShoulderOccluder/index.d.ts +43 -0
  168. package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
  169. package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
  170. package/dist/components/SpringSwing/index.d.ts +1 -0
  171. package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
  172. package/dist/components/index.d.ts +8 -0
  173. package/dist/config/index.d.ts +0 -1
  174. package/dist/context-DTxSQvp4.js +13 -0
  175. package/dist/context-hA0Rb2Xa.cjs +1 -0
  176. package/dist/contexts-BH7PdKFS.cjs +1 -0
  177. package/dist/contexts-jak8-tND.js +667 -0
  178. package/dist/coordinates/index.d.ts +2 -0
  179. package/dist/coordinates/side.d.ts +40 -0
  180. package/dist/debug-ui/default-setting.cjs +2 -2
  181. package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
  182. package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
  183. package/dist/debug-ui/index.d.ts +4 -3
  184. package/dist/debug-ui/media-source/index.d.ts +1 -1
  185. package/dist/debug-ui/media-source/session.d.ts +30 -2
  186. package/dist/debug-ui/media-source.cjs +1 -1
  187. package/dist/debug-ui/media-source.js +1 -1
  188. package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
  189. package/dist/debug-ui/product-hotspots/index.d.ts +3 -2
  190. package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
  191. package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
  192. package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
  193. package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
  194. package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
  195. package/dist/debug-ui/settings-panel/index.d.ts +6 -1
  196. package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
  197. package/dist/debug-ui/xr-diagnostics/index.d.ts +3 -2
  198. package/dist/debug-ui.cjs +3 -3
  199. package/dist/debug-ui.js +2250 -2472
  200. package/dist/entries/all.d.ts +3 -1
  201. package/dist/entries/core.d.ts +3 -2
  202. package/dist/entries/face-effects.d.ts +114 -8
  203. package/dist/entries/instructions.d.ts +48 -0
  204. package/dist/entries/internal.d.ts +2 -1
  205. package/dist/entries/low-level.d.ts +28 -1
  206. package/dist/entries/particles.d.ts +11 -0
  207. package/dist/entries/tracking.d.ts +37 -2
  208. package/dist/face-atlas/attributes.d.ts +30 -0
  209. package/dist/face-atlas/eyes.d.ts +272 -0
  210. package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
  211. package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
  212. package/dist/face-atlas/glsl/common.d.ts +55 -0
  213. package/dist/face-atlas/glsl/design.d.ts +49 -0
  214. package/dist/face-atlas/glsl/eyes.d.ts +73 -0
  215. package/dist/face-atlas/glsl/finish.d.ts +24 -0
  216. package/dist/face-atlas/glsl/format.d.ts +4 -0
  217. package/dist/face-atlas/glsl/index.d.ts +59 -0
  218. package/dist/face-atlas/glsl/shading.d.ts +15 -0
  219. package/dist/face-atlas/glsl/shapes.d.ts +66 -0
  220. package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
  221. package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
  222. package/dist/face-atlas/guide.d.ts +51 -0
  223. package/dist/face-atlas/index.d.ts +25 -0
  224. package/dist/face-atlas/lead.d.ts +117 -0
  225. package/dist/face-atlas/madeUpCamera.d.ts +125 -0
  226. package/dist/face-atlas/masks.d.ts +53 -0
  227. package/dist/face-atlas/obj.d.ts +69 -0
  228. package/dist/face-atlas/polylines.d.ts +63 -0
  229. package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
  230. package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
  231. package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
  232. package/dist/face-atlas/probe/constants.d.ts +137 -0
  233. package/dist/face-atlas/probe/glsl.d.ts +43 -0
  234. package/dist/face-atlas/probe/lightFit.d.ts +108 -0
  235. package/dist/face-atlas/probe/schedule.d.ts +44 -0
  236. package/dist/face-atlas/probe/selfTest.d.ts +87 -0
  237. package/dist/face-atlas/probe/stats.d.ts +143 -0
  238. package/dist/face-atlas/probe/targets.d.ts +70 -0
  239. package/dist/face-atlas/probe/unwrap.d.ts +76 -0
  240. package/dist/face-atlas/quality.d.ts +28 -0
  241. package/dist/face-atlas/regions.d.ts +31 -0
  242. package/dist/face-atlas/registry.d.ts +252 -0
  243. package/dist/face-atlas/renderState.d.ts +86 -0
  244. package/dist/face-atlas/selfOcclusion.d.ts +62 -0
  245. package/dist/face-atlas/shading.d.ts +406 -0
  246. package/dist/face-atlas/shapes.d.ts +86 -0
  247. package/dist/face-atlas/sides.d.ts +41 -0
  248. package/dist/face-atlas/skinMask.d.ts +35 -0
  249. package/dist/face-atlas/surface.d.ts +155 -0
  250. package/dist/face-atlas/topology.d.ts +44 -0
  251. package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
  252. package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
  253. package/dist/face-character/bindFaceModel.d.ts +106 -0
  254. package/dist/face-character/canonicalFace.d.ts +17 -0
  255. package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
  256. package/dist/face-character/canonicalFacePositions.d.ts +7 -0
  257. package/dist/face-character/driveFaceModel.d.ts +57 -0
  258. package/dist/face-character/expressionOutputs.d.ts +45 -0
  259. package/dist/face-character/faceExpressions.d.ts +104 -0
  260. package/dist/face-character/faceImageLandmarker.d.ts +93 -0
  261. package/dist/face-character/faceMeshBinding.d.ts +62 -0
  262. package/dist/face-character/faceMorph.d.ts +77 -0
  263. package/dist/face-character/faceMorphs.d.ts +46 -0
  264. package/dist/face-character/facePhoto.d.ts +138 -0
  265. package/dist/face-character/facePiercings.d.ts +116 -0
  266. package/dist/face-character/facePin.d.ts +131 -0
  267. package/dist/face-character/faceReprojection.d.ts +273 -0
  268. package/dist/face-character/faceReprojector.d.ts +171 -0
  269. package/dist/face-character/faceRig.d.ts +176 -0
  270. package/dist/face-character/faceSwapPresence.d.ts +85 -0
  271. package/dist/face-character/faceTexture.d.ts +169 -0
  272. package/dist/face-character/faceTextureBaker.d.ts +86 -0
  273. package/dist/face-character/faceTextureGuide.d.ts +106 -0
  274. package/dist/face-character/faceTextureStats.d.ts +298 -0
  275. package/dist/face-character/faceTransfer.d.ts +396 -0
  276. package/dist/face-character/faceTransferGeometry.d.ts +109 -0
  277. package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
  278. package/dist/face-character/faceWarp3D.d.ts +101 -0
  279. package/dist/face-character/faceless.d.ts +79 -0
  280. package/dist/face-character/featureWarp.d.ts +28 -0
  281. package/dist/face-character/liveFaceRegistry.d.ts +370 -0
  282. package/dist/face-character/liveValue.d.ts +12 -0
  283. package/dist/face-character/memo.d.ts +15 -0
  284. package/dist/face-effects.cjs +2252 -83
  285. package/dist/face-effects.js +14234 -1231
  286. package/dist/face-expression/index.d.ts +182 -0
  287. package/dist/face-info/landmarks.d.ts +17 -3
  288. package/dist/face-info/types.d.ts +20 -3
  289. package/dist/gestures/definitions.d.ts +15 -2
  290. package/dist/gestures/index.d.ts +1 -1
  291. package/dist/gestures/measures.d.ts +21 -8
  292. package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
  293. package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
  294. package/dist/hand/armFit.d.ts +46 -0
  295. package/dist/hand/armMask.d.ts +178 -0
  296. package/dist/hand/handCutout.d.ts +23 -0
  297. package/dist/hand/handCutoutRegistry.d.ts +7 -0
  298. package/dist/hand/handGestures.d.ts +524 -0
  299. package/dist/hand/handPose.d.ts +98 -0
  300. package/dist/hand/handRigSolver.d.ts +159 -0
  301. package/dist/hand/handTattoo.d.ts +81 -0
  302. package/dist/hand/handTouch.d.ts +240 -0
  303. package/dist/hand/wrist.d.ts +44 -0
  304. package/dist/hand/wristFilter.d.ts +44 -0
  305. package/dist/hooks/selectors.d.ts +8 -0
  306. package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
  307. package/dist/hooks/useTrackerContext.d.ts +6 -0
  308. package/dist/index-B1_TzJaI.js +1104 -0
  309. package/dist/index-BavF06C6.js +190 -0
  310. package/dist/index-BfFmpddl.cjs +21 -0
  311. package/dist/index-BuBzneeW.cjs +46 -0
  312. package/dist/index-CGsQWodV.cjs +1 -0
  313. package/dist/index-CIe7eCMH.js +3200 -0
  314. package/dist/index-CfSF8LXa.cjs +1 -0
  315. package/dist/index-D5GTzOzD.cjs +1 -0
  316. package/dist/index-DBhQzvVa.js +314 -0
  317. package/dist/index-DE17y0ZI.cjs +1 -0
  318. package/dist/index-JII7huPk.js +442 -0
  319. package/dist/index-tpCr9CLj.cjs +1 -0
  320. package/dist/{renderPasses-NnKZVfBy.js → index-w1S7fI2B.js} +219 -247
  321. package/dist/index-zGaqrz_K.js +188 -0
  322. package/dist/instructions.cjs +30 -0
  323. package/dist/instructions.js +1507 -0
  324. package/dist/{internal-vsfNQycj.js → internal-B90P-clC.js} +138 -118
  325. package/dist/internal-Cjinca64.cjs +1 -0
  326. package/dist/internal.cjs +1 -1
  327. package/dist/internal.js +15 -10
  328. package/dist/iris/compute.d.ts +7 -5
  329. package/dist/iris/types.d.ts +6 -4
  330. package/dist/{landmarkMask-CbTFzBYG.js → landmarkMask-BFDyBnKM.js} +6 -6
  331. package/dist/landmarks-BlUqf5MZ.cjs +1 -0
  332. package/dist/landmarks-bftdwq6Z.js +76 -0
  333. package/dist/loaders-BGAUACsd.js +363 -0
  334. package/dist/loaders-BJ1_QCHt.cjs +1 -0
  335. package/dist/low-level.cjs +1 -1
  336. package/dist/low-level.js +666 -602
  337. package/dist/main.cjs +1 -1
  338. package/dist/main.js +866 -1182
  339. package/dist/models/Body/index.d.ts +2 -0
  340. package/dist/models/Face/constants.d.ts +8 -0
  341. package/dist/models/Face/index.d.ts +3 -11
  342. package/dist/models/Face/rotation.d.ts +18 -3
  343. package/dist/models/Hand/HandTracking.d.ts +17 -1
  344. package/dist/models/Segmentation/index.d.ts +2 -0
  345. package/dist/models/nodeSource.d.ts +9 -0
  346. package/dist/particles/emission.d.ts +24 -0
  347. package/dist/particles/eyes.d.ts +24 -0
  348. package/dist/particles/glsl.d.ts +14 -0
  349. package/dist/particles/index.d.ts +10 -0
  350. package/dist/particles/motion.d.ts +42 -0
  351. package/dist/particles/presets.d.ts +12 -0
  352. package/dist/particles/ring.d.ts +58 -0
  353. package/dist/particles/selfTest.d.ts +53 -0
  354. package/dist/particles/settings.d.ts +127 -0
  355. package/dist/particles/shapes.d.ts +29 -0
  356. package/dist/particles/spawner.d.ts +60 -0
  357. package/dist/particles/system.d.ts +64 -0
  358. package/dist/particles.cjs +122 -0
  359. package/dist/particles.js +774 -0
  360. package/dist/product.cjs +1 -1
  361. package/dist/product.js +29 -29
  362. package/dist/{providers-C0Dlhh9Z.js → providers-C8rE26Uf.js} +127 -126
  363. package/dist/providers-DHsrhDI2.cjs +62 -0
  364. package/dist/render/renderPasses.d.ts +8 -0
  365. package/dist/render/sceneBeforeRender.d.ts +12 -0
  366. package/dist/{renderGroups-CN1cGFUo.js → renderGroups-B38pUaX2.js} +1 -1
  367. package/dist/{renderGroups-O4KmaMl9.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
  368. package/dist/renderPasses-B6l8IpJv.js +1290 -0
  369. package/dist/renderPasses-dqmkft4P.cjs +158 -0
  370. package/dist/renderState-CJNmj5jz.js +39 -0
  371. package/dist/renderState-apSfg4eR.cjs +1 -0
  372. package/dist/scene-object.cjs +1 -1
  373. package/dist/scene-object.js +2 -2
  374. package/dist/segmentation-Cb3ouK6Z.js +1758 -0
  375. package/dist/segmentation-D9pYO6aR.cjs +1 -0
  376. package/dist/segmentation2d/types.d.ts +6 -0
  377. package/dist/select-Ck5LGz-J.cjs +1 -0
  378. package/dist/select-pYRo_win.js +233 -0
  379. package/dist/selectors-C4X71aoD.cjs +1 -0
  380. package/dist/selectors-DmNaKIwE.js +196 -0
  381. package/dist/session-BrH8G7iJ.cjs +31 -0
  382. package/dist/session-DgA_z6O1.js +418 -0
  383. package/dist/{settings-aQk845NJ.js → settings-BJ7FMBsO.js} +53 -15
  384. package/dist/settings-C63FMBlF.cjs +1 -0
  385. package/dist/similarityFit-BFqHND2e.cjs +1 -0
  386. package/dist/similarityFit-Bbz-R8AY.js +91 -0
  387. package/dist/spring/index.d.ts +2 -0
  388. package/dist/spring/spring.d.ts +69 -0
  389. package/dist/spring/swing.d.ts +54 -0
  390. package/dist/tracking.cjs +10 -1
  391. package/dist/tracking.js +1002 -855
  392. package/dist/trigger-D0Pm9noT.cjs +49 -0
  393. package/dist/trigger-IQeys0oS.js +2128 -0
  394. package/dist/types/face.d.ts +20 -1
  395. package/dist/types/hand-tracking.d.ts +9 -0
  396. package/dist/types/nodes.d.ts +20 -1
  397. package/dist/types/segmentation.d.ts +5 -0
  398. package/dist/updateThrottle-BseecYag.js +4 -0
  399. package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
  400. package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
  401. package/dist/useFaceInfo-J4x7LsqL.js +76 -0
  402. package/dist/useFaceResultReader-BvEo5REG.js +61 -0
  403. package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
  404. package/dist/useInstructionHold-DOu-RpCM.js +53 -0
  405. package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
  406. package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
  407. package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
  408. package/dist/{useXRCapabilities-B1R2ghy-.cjs → useXRCapabilities-Cr3RzuAW.cjs} +1 -1
  409. package/dist/{useXRCapabilities-C68v__wB.js → useXRCapabilities-Cxmlmpbd.js} +1 -1
  410. package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
  411. package/dist/utils/headOccluderFit.d.ts +42 -0
  412. package/dist/utils/integrity.d.ts +17 -0
  413. package/dist/utils/resolveNumFaces.d.ts +13 -0
  414. package/dist/utils/shoulderOccluderFit.d.ts +38 -0
  415. package/dist/utils/similarityFit.d.ts +23 -0
  416. package/dist/uv-BMFt19bg.cjs +1 -0
  417. package/dist/{index-CsUdQ-pn.js → uv-DJU_XfmN.js} +15 -249
  418. package/docs/SDK_DOCUMENTATION.md +1 -2
  419. package/docs/api/adaptive-quality.mdx +1 -1
  420. package/docs/api/body-instructions.mdx +285 -0
  421. package/docs/api/body-triggers.mdx +234 -0
  422. package/docs/api/camera-permission.mdx +1 -1
  423. package/docs/api/coordinate-spaces.mdx +7 -4
  424. package/docs/api/cross-camera.mdx +3 -2
  425. package/docs/api/debug-ui-scene-editor.mdx +23 -2
  426. package/docs/api/external-face-mesh.mdx +231 -0
  427. package/docs/api/face-actions.mdx +20 -16
  428. package/docs/api/face-attribute-expression.mdx +1 -1
  429. package/docs/api/face-binding-anchors.mdx +4 -2
  430. package/docs/api/face-character.mdx +157 -0
  431. package/docs/api/face-effects.mdx +3 -0
  432. package/docs/api/face-expression-controller.mdx +153 -0
  433. package/docs/api/face-info.mdx +17 -11
  434. package/docs/api/face-inset.mdx +204 -0
  435. package/docs/api/face-instructions.mdx +183 -0
  436. package/docs/api/face-liquify.mdx +196 -0
  437. package/docs/api/face-mesh.mdx +4 -7
  438. package/docs/api/face-morph.mdx +117 -0
  439. package/docs/api/face-painting.mdx +7 -0
  440. package/docs/api/face-reprojection.mdx +154 -0
  441. package/docs/api/face-retouching.mdx +18 -10
  442. package/docs/api/face-swap.mdx +350 -0
  443. package/docs/api/face-warp-3d.mdx +166 -0
  444. package/docs/api/faceless.mdx +143 -0
  445. package/docs/api/gestures.mdx +68 -32
  446. package/docs/api/hair.mdx +97 -0
  447. package/docs/api/hand-instructions.mdx +222 -0
  448. package/docs/api/hand-rig.mdx +535 -0
  449. package/docs/api/hand-touch.mdx +162 -0
  450. package/docs/api/head-occluder.mdx +563 -0
  451. package/docs/api/holistic-tracker.mdx +6 -1
  452. package/docs/api/instructions.mdx +323 -0
  453. package/docs/api/iris-tracking.mdx +24 -19
  454. package/docs/api/made-up-camera.mdx +131 -0
  455. package/docs/api/makeup-skin-tone.mdx +135 -0
  456. package/docs/api/makeup.mdx +353 -0
  457. package/docs/api/multi-subject.mdx +4 -1
  458. package/docs/api/particles.mdx +155 -0
  459. package/docs/api/person-cutout.mdx +1 -1
  460. package/docs/api/pin-to-face-mesh.mdx +274 -0
  461. package/docs/api/product-ar.mdx +5 -2
  462. package/docs/api/segmentation-overlay.mdx +1 -1
  463. package/docs/docs.json +29 -1
  464. package/docs/examples/lip-shaders.mdx +82 -33
  465. package/docs/guides/face-atlas-template.svg +1 -0
  466. package/docs/guides/face-atlas-textures.mdx +186 -0
  467. package/docs/guides/face-texture-template.svg +1 -0
  468. package/docs/guides/harness-debug-ui.mdx +4 -4
  469. package/docs/guides/lip-effect-textures.mdx +178 -102
  470. package/docs/guides/lip-uv-template.png +0 -0
  471. package/docs/guides/lip-uv-template.svg +1 -1
  472. package/docs/guides/makeup-design-textures.mdx +109 -0
  473. package/docs/introduction.mdx +1 -2
  474. package/package.json +11 -1
  475. package/dist/DebuggerUI-C-ldiozL.js +0 -269
  476. package/dist/DebuggerUI-CWX5EtQv.cjs +0 -1
  477. package/dist/FaceMeshRenderer-BEEXZwS6.cjs +0 -158
  478. package/dist/FaceMeshRenderer-UuH5sTXG.js +0 -1322
  479. package/dist/FaceRetouch-C7h7x9kd.js +0 -683
  480. package/dist/FaceRetouch-DqftT26Y.cjs +0 -134
  481. package/dist/GLTFLoader-C5q63sKO.js +0 -1633
  482. package/dist/GLTFLoader-Cb_CRwmG.cjs +0 -1
  483. package/dist/SegmentationOverlay-DQuW3dsc.js +0 -133
  484. package/dist/SegmentationOverlay-aWVod8Kl.cjs +0 -1
  485. package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
  486. package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
  487. package/dist/components/FaceWarp3D/warp.d.ts +0 -13
  488. package/dist/contexts-CO0sd4JQ.cjs +0 -1
  489. package/dist/contexts-FzlnnMYD.js +0 -669
  490. package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
  491. package/dist/getFaceInfo-BkZfaQs-.js +0 -118
  492. package/dist/getFaceInfo-ahPxQFGu.cjs +0 -1
  493. package/dist/index--RgGzZ6X.cjs +0 -47
  494. package/dist/index-CHVbH0hz.js +0 -214
  495. package/dist/index-CeVkgsag.cjs +0 -1
  496. package/dist/index-CnGox6Xr.js +0 -3054
  497. package/dist/index-DKBAh6hV.cjs +0 -1
  498. package/dist/index-DsZwTfG0.cjs +0 -1
  499. package/dist/index-Dw6tj2Mi.js +0 -144
  500. package/dist/index-OCPjOaeP.cjs +0 -1
  501. package/dist/index-s9pF4zkG.js +0 -2053
  502. package/dist/internal-BYza1h8_.cjs +0 -1
  503. package/dist/measures-9dQPdw96.js +0 -154
  504. package/dist/measures-KfJzpvod.cjs +0 -1
  505. package/dist/providers-YNwkmNeK.cjs +0 -62
  506. package/dist/renderPasses-Cg-zqmEz.cjs +0 -21
  507. package/dist/screenTransform-BenfCtZt.js +0 -44
  508. package/dist/screenTransform-BiXdpVf0.cjs +0 -1
  509. package/dist/segmentation-9PhSvc-R.cjs +0 -1
  510. package/dist/segmentation-CeOTKemr.js +0 -5
  511. package/dist/selectors-C5G1PMYL.js +0 -195
  512. package/dist/selectors-Du_PsVnW.cjs +0 -1
  513. package/dist/session-BBr0yN8h.cjs +0 -31
  514. package/dist/session-Cy0m7l7-.js +0 -363
  515. package/dist/settings-DRR7-snV.cjs +0 -1
  516. package/dist/useFaceInfo-Blf7FCu3.js +0 -303
  517. package/dist/useFaceInfo-C5mO8NQY.cjs +0 -1
@@ -1,1322 +0,0 @@
1
- import { jsx as M, jsxs as Ie, Fragment as et } from "react/jsx-runtime";
2
- import { useLoader as fe, useThree as Zt, useFrame as en } from "@react-three/fiber";
3
- import { useRef as m, useMemo as J, useState as tt, useCallback as Ye, useEffect as Fe } from "react";
4
- import * as k from "three";
5
- import { MathUtils as nt, Color as tn, Vector2 as qe } from "three";
6
- import { l as se, p as nn, X as rn, F as an } from "./index-CnGox6Xr.js";
7
- import { a as on, u as sn } from "./selectors-C5G1PMYL.js";
8
- import { s as cn, t as ln, p as dn, b as fn } from "./index-CsUdQ-pn.js";
9
- import { T as Me, c as un, a as hn } from "./index-Dw6tj2Mi.js";
10
- import { TransformControls as mn } from "@react-three/drei";
11
- const pn = (e) => {
12
- const n = m(null);
13
- if (n.current) {
14
- const t = n.current;
15
- Object.keys(e).forEach((r) => {
16
- t[r].value = e[r];
17
- });
18
- } else {
19
- const t = {};
20
- Object.keys(e).forEach((r) => {
21
- t[r] = { value: e[r] };
22
- }), n.current = t;
23
- }
24
- return n.current;
25
- }, we = 8, Q = {
26
- type: "linear",
27
- stops: [
28
- { offset: 0, color: "#38bdf8" },
29
- { offset: 1, color: "#a78bfa" }
30
- ],
31
- angle: 0,
32
- center: { x: 0.5, y: 0.5 },
33
- radius: 0.5
34
- }, yn = (e) => {
35
- const n = e.slice(0, we).map((t) => ({ ...t, offset: nt.clamp(t.offset, 0, 1) })).sort((t, r) => t.offset - r.offset);
36
- return n.length >= 2 ? n : Q.stops.map((t) => ({ ...t }));
37
- }, gn = (e) => ({
38
- ...Q,
39
- ...e,
40
- center: { ...Q.center, ...e == null ? void 0 : e.center },
41
- radius: Math.max(0.01, (e == null ? void 0 : e.radius) ?? Q.radius),
42
- stops: yn((e == null ? void 0 : e.stops) ?? Q.stops)
43
- }), bn = `
44
- varying vec2 vPosition;
45
- void main() {
46
- vPosition = position.xy;
47
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
48
- }
49
- `, En = `
50
- #define MAX_STOPS 8
51
- uniform vec3 stopColors[MAX_STOPS];
52
- uniform float stopOffsets[MAX_STOPS];
53
- uniform int stopCount;
54
- uniform int gradientType;
55
- uniform vec2 direction;
56
- uniform vec2 center;
57
- uniform float radius;
58
- uniform float angleOffset;
59
- uniform float opacity;
60
- varying vec2 vPosition;
61
-
62
- vec3 sampleGradient(float amount) {
63
- vec3 color = stopColors[0];
64
- for (int index = 1; index < MAX_STOPS; index++) {
65
- if (index >= stopCount) break;
66
- if (amount <= stopOffsets[index]) {
67
- float width = max(0.0001, stopOffsets[index] - stopOffsets[index - 1]);
68
- return mix(stopColors[index - 1], stopColors[index], clamp((amount - stopOffsets[index - 1]) / width, 0.0, 1.0));
69
- }
70
- color = stopColors[index];
71
- }
72
- return color;
73
- }
74
-
75
- void main() {
76
- vec2 delta = vPosition - center;
77
- float amount;
78
- if (gradientType == 1) {
79
- amount = clamp(length(delta) / radius, 0.0, 1.0);
80
- } else if (gradientType == 2) {
81
- amount = fract(atan(delta.y, delta.x) / 6.28318530718 + 0.5 + angleOffset);
82
- } else {
83
- amount = clamp(dot(delta, direction) + 0.5, 0.0, 1.0);
84
- }
85
- gl_FragColor = vec4(sampleGradient(amount), opacity);
86
- }
87
- `, Mn = { linear: 0, radial: 1, angular: 2 }, xn = ({ opacity: e = 1, value: n }) => {
88
- const t = J(() => {
89
- const a = gn(n), o = nt.degToRad(a.angle), s = a.stops.map((f) => new tn(f.color)), l = a.stops.map((f) => f.offset);
90
- for (; s.length < we; ) s.push(s[s.length - 1]);
91
- for (; l.length < we; ) l.push(1);
92
- return {
93
- stopColors: s,
94
- stopOffsets: l,
95
- stopCount: a.stops.length,
96
- gradientType: Mn[a.type],
97
- direction: new qe(Math.cos(o), Math.sin(o)),
98
- center: new qe(a.center.x - 0.5, 0.5 - a.center.y),
99
- radius: a.radius,
100
- angleOffset: a.angle / 360,
101
- opacity: e
102
- };
103
- }, [e, n]), r = pn(t);
104
- return /* @__PURE__ */ M(
105
- "shaderMaterial",
106
- {
107
- uniforms: r,
108
- vertexShader: bn,
109
- fragmentShader: En,
110
- transparent: e < 1,
111
- depthTest: !1,
112
- depthWrite: !1,
113
- toneMapped: !1
114
- }
115
- );
116
- }, vn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO2YpZcAAAAASUVORK5CYII=", fr = {
117
- source: "solid",
118
- color: "#ffffff",
119
- opacity: 1,
120
- textureUrl: "",
121
- gradient: Q
122
- }, rt = (e) => ({
123
- ...Q,
124
- stops: [
125
- { offset: 0, color: "#ffffff" },
126
- { offset: 1, color: e }
127
- ]
128
- }), An = ({
129
- depthTest: e,
130
- depthWrite: n,
131
- settings: t,
132
- side: r,
133
- toneMapped: a
134
- }) => {
135
- const o = fe(
136
- k.TextureLoader,
137
- t.textureUrl || vn
138
- );
139
- return /* @__PURE__ */ M(
140
- "meshBasicMaterial",
141
- {
142
- color: t.color,
143
- map: o,
144
- transparent: !0,
145
- opacity: t.opacity,
146
- side: r,
147
- depthWrite: n,
148
- depthTest: e,
149
- toneMapped: a
150
- }
151
- );
152
- }, Sn = ({
153
- depthTest: e = !1,
154
- depthWrite: n = !1,
155
- settings: t,
156
- side: r,
157
- toneMapped: a = !1
158
- }) => {
159
- const o = J(
160
- () => t.gradient ?? rt(t.color),
161
- [t.color, t.gradient]
162
- );
163
- return t.source === "gradient" ? /* @__PURE__ */ M(xn, { value: o, opacity: t.opacity }) : t.source === "texture" ? /* @__PURE__ */ M(
164
- An,
165
- {
166
- settings: t,
167
- side: r,
168
- depthTest: e,
169
- depthWrite: n,
170
- toneMapped: a
171
- }
172
- ) : /* @__PURE__ */ M(
173
- "meshBasicMaterial",
174
- {
175
- color: t.color,
176
- transparent: !0,
177
- opacity: t.opacity,
178
- side: r,
179
- depthWrite: n,
180
- depthTest: e,
181
- toneMapped: a
182
- }
183
- );
184
- }, xe = Math.PI / 180, ve = 180 / Math.PI, W = (e) => Number(e.toFixed(6)), Je = {
185
- enabled: !0,
186
- linked: {
187
- position: !1,
188
- rotation: !1,
189
- scale: !1
190
- },
191
- showTransformControls: !1,
192
- transformControlMode: "translate",
193
- transformControlSpace: "local",
194
- position: { x: 0, y: 0, z: 0 },
195
- rotation: { x: 0, y: 0, z: 0 },
196
- scale: { x: 1, y: 1, z: 1 },
197
- visible: !0
198
- }, ur = ({ children: e, objectRef: n, onChange: t, value: r }) => {
199
- const a = m(null), o = m(n);
200
- o.current = n;
201
- const [s, l] = tt(null), f = Ye((i) => {
202
- var u;
203
- a.current = i, l(i), (u = o.current) == null || u.call(o, i);
204
- }, []), d = Ye(() => {
205
- const i = a.current;
206
- !i || !t || t({
207
- ...r,
208
- position: {
209
- x: W(i.position.x),
210
- y: W(i.position.y),
211
- z: W(i.position.z)
212
- },
213
- rotation: {
214
- x: W(i.rotation.x * ve),
215
- y: W(i.rotation.y * ve),
216
- z: W(i.rotation.z * ve)
217
- },
218
- scale: {
219
- x: W(i.scale.x),
220
- y: W(i.scale.y),
221
- z: W(i.scale.z)
222
- }
223
- });
224
- }, [t, r]);
225
- return r.enabled ? /* @__PURE__ */ Ie(et, { children: [
226
- /* @__PURE__ */ M(
227
- "group",
228
- {
229
- ref: f,
230
- position: [r.position.x, r.position.y, r.position.z],
231
- rotation: [
232
- r.rotation.x * xe,
233
- r.rotation.y * xe,
234
- r.rotation.z * xe
235
- ],
236
- scale: [r.scale.x, r.scale.y, r.scale.z],
237
- visible: r.visible,
238
- children: e
239
- }
240
- ),
241
- s && r.showTransformControls && /* @__PURE__ */ M(
242
- mn,
243
- {
244
- object: s,
245
- mode: r.transformControlMode,
246
- space: r.transformControlSpace,
247
- size: 0.85,
248
- onMouseUp: d,
249
- onObjectChange: d
250
- }
251
- )
252
- ] }) : null;
253
- }, ae = (e) => Math.min(1, Math.max(0, e)), O = (e, n, t) => ae(1 - Math.abs(e - n) / t), Tn = (e) => {
254
- let n = 1 / 0, t = -1 / 0, r = 1 / 0, a = -1 / 0;
255
- for (const l of e)
256
- n = Math.min(n, l.x), t = Math.max(t, l.x), r = Math.min(r, l.y), a = Math.max(a, l.y);
257
- const o = Math.max(t - n, 1e-3), s = Math.max(a - r, 1e-3);
258
- return {
259
- centerX: n + o * 0.5,
260
- centerY: r + s * 0.5,
261
- width: o,
262
- height: s
263
- };
264
- }, Rn = (e) => e != null && e.enabled ? (e.strength ?? 1) !== 0 && Object.entries(e).some(
265
- ([n, t]) => n !== "enabled" && n !== "strength" && typeof t == "number" && t !== 0
266
- ) : !1, _n = (e, n, t, r) => {
267
- const a = t.enabled ? t.strength ?? 1 : 0;
268
- if (a === 0)
269
- return r.x = e.x, r.y = e.y, r.z = e.z, r;
270
- const o = (e.x - n.centerX) / n.width, s = (e.y - n.centerY) / n.height, l = Math.abs(o), f = ae((-s + 0.42) / 0.55), d = O(s, -0.02, 0.34), i = O(s, -0.24, 0.16) * ae((l - 0.05) / 0.28), u = O(s, 0.02, 0.26) * O(l, 0, 0.18), c = O(s, 0.29, 0.18) * O(l, 0, 0.36), p = ae((s - 0.16) / 0.36), h = d * O(l, 0.34, 0.22), A = f * O(l, 0, 0.48), x = O(s, -0.19, 0.1) * ae((l - 0.05) / 0.3), U = O(s, 0.48, 0.2) * O(l, 0, 0.26);
271
- let g = e.x, b = e.y, R = e.z;
272
- const S = (K, L = 1) => {
273
- g += o * n.width * K * a * L;
274
- }, E = (K, L = 1) => {
275
- b += s * n.height * K * a * L;
276
- };
277
- S(t.faceWidth ?? 0), E(t.faceHeight ?? 0), S(t.faceRoundness ?? 0, d * (1 - l)), b -= n.height * (t.midfaceHeight ?? 0) * a * d * 0.25, E(-(t.foreheadHeight ?? 0), A), S(t.foreheadWidth ?? 0, A), S(
278
- t.cheekboneWidth ?? 0,
279
- O(s, -0.06, 0.16) * O(l, 0.34, 0.2)
280
- ), S(t.cheekWidth ?? 0, h), S(t.jawWidth ?? 0, p), E(t.chinHeight ?? 0, U), b -= n.height * (t.scalpHeight ?? 0) * a * f * 0.3, R -= (t.midfaceDepth ?? 0) * a * d * 0.08, R += (t.cheekHollowness ?? 0) * a * h * 0.06, R -= (t.browDepth ?? 0) * a * x * 0.05, b -= n.height * (t.browHeight ?? 0) * a * x * 0.2, g += Math.sign(o || 1) * n.width * (t.browDistance ?? 0) * a * x * 0.16;
281
- const _ = (t.headCurve ?? 0) * a * (s + 0.1);
282
- R -= _ * _ * 0.04 * Math.sign(t.headCurve ?? 0), g += n.width * (t.faceTwist ?? 0) * a * s * 0.18;
283
- const v = (t.faceSwirl ?? 0) * a * 0.22;
284
- g += -s * n.width * v, b += o * n.height * v;
285
- const F = o < 0 ? t.leftEyeSize ?? 0 : t.rightEyeSize ?? 0, N = ((t.eyeSize ?? 0) + F) * a * i;
286
- g += o * n.width * N * 0.45, b += (s + 0.24) * n.height * N * 0.7, g += Math.sign(o || 1) * n.width * (t.eyeDistance ?? 0) * a * i * 0.2, g += n.width * (o < 0 ? t.leftEyeX ?? 0 : t.rightEyeX ?? 0) * a * i * 0.15, b += n.height * (o < 0 ? t.leftEyeY ?? 0 : t.rightEyeY ?? 0) * a * i * 0.15;
287
- const $ = (t.noseSize ?? 0) * a * u;
288
- return g += o * n.width * $ * 0.7, b += (s - 0.02) * n.height * $ * 0.5, b += n.height * (t.noseLength ?? 0) * a * u * Math.max(s + 0.08, 0) * 0.4, R -= (t.noseSize ?? 0) * a * u * 0.08, g += o * n.width * (t.mouthWidth ?? 0) * a * c, b += (s - 0.29) * n.height * (t.mouthHeight ?? 0) * a * c, r.x = g, r.y = b, r.z = R, r;
289
- }, Ae = /* @__PURE__ */ new Set([
290
- 61,
291
- 146,
292
- 91,
293
- 181,
294
- 84,
295
- 17,
296
- 314,
297
- 405,
298
- 321,
299
- 375,
300
- 291,
301
- 78,
302
- 95,
303
- 88,
304
- 178,
305
- 87,
306
- 14,
307
- 317,
308
- 402,
309
- 318,
310
- 324,
311
- 308,
312
- 191,
313
- 80,
314
- 81,
315
- 82,
316
- 13,
317
- 312,
318
- 311,
319
- 310,
320
- 415
321
- ]), at = [
322
- 61,
323
- 146,
324
- 91,
325
- 181,
326
- 84,
327
- 17,
328
- 314,
329
- 405,
330
- 321,
331
- 375,
332
- 291,
333
- 409,
334
- 270,
335
- 269,
336
- 267,
337
- 0,
338
- 37,
339
- 39,
340
- 40,
341
- 185
342
- ], Oe = [
343
- 78,
344
- 95,
345
- 88,
346
- 178,
347
- 87,
348
- 14,
349
- 317,
350
- 402,
351
- 318,
352
- 324,
353
- 308,
354
- 415,
355
- 310,
356
- 311,
357
- 312,
358
- 13,
359
- 82,
360
- 81,
361
- 80,
362
- 191
363
- ], Se = new Set(Oe), Te = /* @__PURE__ */ new Set([
364
- 33,
365
- 7,
366
- 163,
367
- 144,
368
- 145,
369
- 153,
370
- 154,
371
- 155,
372
- 133,
373
- 173,
374
- 157,
375
- 158,
376
- 159,
377
- 160,
378
- 161,
379
- 246
380
- ]), Re = /* @__PURE__ */ new Set([
381
- 362,
382
- 382,
383
- 381,
384
- 380,
385
- 374,
386
- 373,
387
- 390,
388
- 249,
389
- 263,
390
- 466,
391
- 388,
392
- 387,
393
- 386,
394
- 385,
395
- 384,
396
- 398
397
- ]), Cn = /* @__PURE__ */ new Set([814, 815, 816, 817, 818, 819, 830, 831, 832, 833]), kn = (e, n, t) => {
398
- const r = Ae.has(e) && Ae.has(n) && Ae.has(t), a = Te.has(e) && Te.has(n) && Te.has(t), o = Re.has(e) && Re.has(n) && Re.has(t);
399
- return r ? "mouth" : a ? "leftEye" : o ? "rightEye" : "base";
400
- }, ue = (e, n) => e < n ? `${e}:${n}` : `${n}:${e}`, ot = (e) => e.map((n, t) => ue(n, e[(t + 1) % e.length])), st = ot(Oe), _e = /* @__PURE__ */ new Set([...ot(at), ...st]), Fn = (e) => {
401
- const n = e.length / 3, t = /* @__PURE__ */ new Map(), r = (c, p) => e[c * 3 + p], a = (c) => {
402
- const p = r(c, 0), h = r(c, 1), A = r(c, 2);
403
- return [ue(p, h), ue(h, A), ue(A, p)];
404
- }, o = (c) => Se.has(r(c, 0)) && Se.has(r(c, 1)) && Se.has(r(c, 2));
405
- for (let c = 0; c < n; c += 1)
406
- a(c).forEach((p) => {
407
- const h = t.get(p);
408
- h ? h.push(c) : t.set(p, [c]);
409
- });
410
- let s = -1;
411
- for (const c of st) {
412
- const p = (t.get(c) ?? []).find((h) => !o(h));
413
- if (p !== void 0) {
414
- s = p;
415
- break;
416
- }
417
- }
418
- if (s < 0) return [];
419
- const l = /* @__PURE__ */ new Set([s]), f = [s], d = /* @__PURE__ */ new Map();
420
- for (; f.length > 0; ) {
421
- const c = f.pop();
422
- a(c).forEach((p) => {
423
- d.set(p, (d.get(p) ?? 0) + 1), !_e.has(p) && (t.get(p) ?? []).forEach((h) => {
424
- l.has(h) || (l.add(h), f.push(h));
425
- });
426
- });
427
- }
428
- const i = [...d].filter(([, c]) => c === 1).map(([c]) => c);
429
- return i.length === _e.size && i.every((c) => _e.has(c)) ? [...l].sort((c, p) => c - p).flatMap((c) => [r(c, 0), r(c, 1), r(c, 2)]) : [];
430
- }, wn = (e, n) => {
431
- const t = new Float32Array(n).fill(1), r = /* @__PURE__ */ new Map(), a = (f, d) => {
432
- r.has(f) || r.set(f, /* @__PURE__ */ new Set()), r.get(f).add(d);
433
- };
434
- for (let f = 0; f < e.length; f += 3) {
435
- const [d, i, u] = [e[f], e[f + 1], e[f + 2]];
436
- a(d, i), a(i, d), a(i, u), a(u, i), a(u, d), a(d, u);
437
- }
438
- const o = (f) => {
439
- const d = /* @__PURE__ */ new Map(), i = f.filter((u) => r.has(u));
440
- i.forEach((u) => d.set(u, 0));
441
- for (let u = 0; u < i.length; u += 1) {
442
- const c = i[u], p = d.get(c) + 1;
443
- r.get(c).forEach((h) => {
444
- d.has(h) || (d.set(h, p), i.push(h));
445
- });
446
- }
447
- return d;
448
- }, s = o(at), l = o(Oe);
449
- return r.forEach((f, d) => {
450
- const i = s.get(d) ?? 0, u = l.get(d) ?? 0;
451
- t[d] = i + u === 0 ? 1 : i / (i + u);
452
- }), t;
453
- }, Un = (e) => {
454
- const n = [], t = [], r = [], a = [], o = [], s = [], l = [], f = [];
455
- let d = 0, i = 0;
456
- e.split(`
457
- `).forEach((x) => {
458
- const U = x.trim();
459
- if (!U) return;
460
- if (U.startsWith("v ")) {
461
- d += 1;
462
- return;
463
- }
464
- if (U.startsWith("vt ")) {
465
- const [, S, E] = U.split(/\s+/);
466
- l.push([Number(S), Number(E)]);
467
- return;
468
- }
469
- if (!U.startsWith("f ")) return;
470
- const g = i;
471
- i += 1;
472
- const [, ...b] = U.split(/\s+/), R = b.map((S) => {
473
- const [E, _] = S.split("/"), v = Number(E) - 1, F = Number(_) - 1;
474
- return F >= 0 && l[F] && !f[v] && (f[v] = l[F]), v;
475
- });
476
- if (!(R.length < 3))
477
- for (let S = 1; S < R.length - 1; S += 1) {
478
- const E = R[0], _ = R[S], v = R[S + 1];
479
- n.push(E, _, v);
480
- const F = kn(E, _, v);
481
- Cn.has(g) ? s.push(E, _, v) : F === "mouth" ? r.push(E, _, v) : F === "leftEye" ? a.push(E, _, v) : F === "rightEye" ? o.push(E, _, v) : t.push(E, _, v);
482
- }
483
- });
484
- const u = [];
485
- for (let x = 0; x < d; x += 1) {
486
- const [U, g] = f[x] ?? [0, 0];
487
- u.push(U, g);
488
- }
489
- const c = new Uint16Array(a), p = new Uint16Array(o), h = new Uint16Array(a.length + o.length);
490
- h.set(c), h.set(p, c.length);
491
- const A = Fn(n);
492
- return {
493
- baseIndices: new Uint16Array(t),
494
- mouthIndices: new Uint16Array(r),
495
- lipIndices: new Uint16Array(A),
496
- lipEdgeDistance: wn(A, d),
497
- leftEyeIndices: c,
498
- rightEyeIndices: p,
499
- eyeIndices: h,
500
- noseIndices: new Uint16Array(s),
501
- uvs: new Float32Array(u),
502
- vertexCount: d
503
- };
504
- }, In = "canonical_face_model.obj", On = new TextDecoder("utf-8"), Ce = /* @__PURE__ */ new Map(), Ln = (e) => {
505
- const n = Ce.get(e);
506
- if (n) return n;
507
- const t = nn(e).then((r) => Un(On.decode(r))).catch((r) => {
508
- throw Ce.delete(e), r;
509
- });
510
- return Ce.set(e, t), t;
511
- }, Dn = (e) => {
512
- const { mesh: n, url: t } = e ?? {}, r = t ?? `${se.sdkAssetsBaseUrl}/${In}`, [a, o] = tt(n ?? null);
513
- return Fe(() => {
514
- if (n) {
515
- o(n);
516
- return;
517
- }
518
- let s = !1;
519
- return Ln(r).then((l) => {
520
- s || o(l);
521
- }).catch((l) => {
522
- s || console.error(`${se.loggerPrefix} canonical face mesh load failed`, l);
523
- }), () => {
524
- s = !0;
525
- };
526
- }, [n, r]), a;
527
- }, C = {
528
- basic: "basic",
529
- standard: "standard",
530
- physical: "physical",
531
- toon: "toon",
532
- normal: "normal",
533
- matcap: "matcap",
534
- wireframe: "wireframe",
535
- shader: "shader"
536
- }, V = {
537
- originalFace: "originalFace",
538
- composite: "composite"
539
- }, j = {
540
- none: "none",
541
- canonical: "canonical",
542
- style2: "style2"
543
- }, ee = {
544
- none: "none",
545
- canonical: "canonical"
546
- }, ce = {
547
- solid: "solid",
548
- gradient: "gradient",
549
- imageUrl: "imageUrl",
550
- mediaUrl: "mediaUrl"
551
- }, oe = {
552
- front: "front",
553
- back: "back",
554
- double: "double"
555
- }, ct = {
556
- normal: "normal",
557
- add: "add",
558
- subtract: "subtract",
559
- multiply: "multiply",
560
- screen: "screen",
561
- overlay: "overlay",
562
- softLight: "softLight",
563
- hardLight: "hardLight",
564
- lighten: "lighten",
565
- darken: "darken",
566
- difference: "difference",
567
- exclusion: "exclusion"
568
- }, Pn = {
569
- textureMap: j.canonical,
570
- alphaMap: ee.canonical,
571
- alphaOpacity: 1
572
- }, Qe = {
573
- ...Pn,
574
- blendMode: ct.hardLight,
575
- blendOpacity: 0.85,
576
- baseColor: "#ffffff",
577
- opacity: 1,
578
- compositeShading: !0
579
- }, P = {
580
- materialType: C.basic,
581
- shaderPreset: V.originalFace,
582
- textureMap: j.none,
583
- alphaMap: ee.none,
584
- alphaOpacity: 1,
585
- side: oe.front,
586
- blendMode: ct.normal,
587
- blendOpacity: 1,
588
- baseColor: "#38bdf8",
589
- opacity: 0.45,
590
- compositeShading: !1
591
- };
592
- C.shader, V.composite, oe.front;
593
- const ke = {
594
- mouth: !0,
595
- eyes: !0,
596
- nose: !0
597
- }, te = {
598
- textureSource: ce.solid,
599
- color: "#111111",
600
- opacity: 0.5
601
- }, Nn = 24, it = 10, Le = (e, n, t) => e !== C.shader ? "none" : n === V.originalFace ? "originalFace" : n === V.composite ? t === j.none ? "originalFace" : "composite" : "none", hr = (e, n) => e === C.basic || e === C.standard || e === C.physical || e === C.toon || e === C.shader && n === V.composite, mr = (e, n, t = j.canonical) => Le(e, n, t) === "composite", Gn = (e, n, t) => Le(e, n, t) === "originalFace", Ue = (e) => e === ce.imageUrl || e === ce.mediaUrl, zn = (e) => e === ce.solid || e === ce.gradient, Ze = {
602
- normal: 0,
603
- add: 1,
604
- subtract: 2,
605
- multiply: 3,
606
- screen: 4,
607
- overlay: 5,
608
- softLight: 6,
609
- hardLight: 7,
610
- lighten: 8,
611
- darken: 9,
612
- difference: 10,
613
- exclusion: 11
614
- }, Hn = `
615
- attribute vec2 faceUv;
616
- varying vec2 vUv;
617
- varying vec2 vFaceUv;
618
- varying vec3 vNormal;
619
-
620
- void main() {
621
- vUv = uv;
622
- vFaceUv = faceUv;
623
- vNormal = normalize(normalMatrix * normal);
624
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
625
- }
626
- `, Bn = `
627
- uniform sampler2D cameraTexture;
628
- uniform sampler2D canonicalTexture;
629
- uniform sampler2D alphaMask;
630
- uniform vec3 textureTint;
631
- uniform float opacity;
632
- uniform int blendMode;
633
- uniform float blendOpacity;
634
- uniform float useCanonicalTexture;
635
- uniform float useAlphaMask;
636
- uniform float alphaOpacity;
637
- uniform float compositeShading;
638
- uniform vec3 lightDirection;
639
- uniform float ambientStrength;
640
- uniform float directionalStrength;
641
- varying vec2 vUv;
642
- varying vec2 vFaceUv;
643
- varying vec3 vNormal;
644
-
645
- vec3 linearToSrgb(vec3 value) {
646
- vec3 low = value * 12.92;
647
- vec3 high = 1.055 * pow(max(value, vec3(0.0)), vec3(1.0 / 2.4)) - 0.055;
648
- return mix(high, low, step(value, vec3(0.0031308)));
649
- }
650
-
651
- vec3 srgbToLinear(vec3 value) {
652
- vec3 low = value / 12.92;
653
- vec3 high = pow(max((value + 0.055) / 1.055, vec3(0.0)), vec3(2.4));
654
- return mix(high, low, step(value, vec3(0.04045)));
655
- }
656
-
657
- float overlayChannel(float base, float blend) {
658
- return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
659
- }
660
-
661
- float hardLightChannel(float base, float blend) {
662
- return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
663
- }
664
-
665
- float softLightChannel(float base, float blend) {
666
- if (blend <= 0.5) {
667
- return base - (1.0 - 2.0 * blend) * base * (1.0 - base);
668
- }
669
-
670
- float d = base <= 0.25
671
- ? ((16.0 * base - 12.0) * base + 4.0) * base
672
- : sqrt(base);
673
-
674
- return base + (2.0 * blend - 1.0) * (d - base);
675
- }
676
-
677
- vec3 applyBlendMode(vec3 base, vec3 blend, int mode) {
678
- if (mode == 0) return blend;
679
- if (mode == 1) return min(base + blend, 1.0);
680
- if (mode == 2) return max(base - blend, 0.0);
681
- if (mode == 3) return base * blend;
682
- if (mode == 4) return 1.0 - (1.0 - base) * (1.0 - blend);
683
- if (mode == 5) {
684
- return vec3(
685
- overlayChannel(base.r, blend.r),
686
- overlayChannel(base.g, blend.g),
687
- overlayChannel(base.b, blend.b)
688
- );
689
- }
690
- if (mode == 6) {
691
- return vec3(
692
- softLightChannel(base.r, blend.r),
693
- softLightChannel(base.g, blend.g),
694
- softLightChannel(base.b, blend.b)
695
- );
696
- }
697
- if (mode == 7) {
698
- return vec3(
699
- hardLightChannel(base.r, blend.r),
700
- hardLightChannel(base.g, blend.g),
701
- hardLightChannel(base.b, blend.b)
702
- );
703
- }
704
- if (mode == 8) return max(base, blend);
705
- if (mode == 9) return min(base, blend);
706
- if (mode == 10) return abs(base - blend);
707
- return base + blend - 2.0 * base * blend;
708
- }
709
-
710
- void main() {
711
- vec3 base = linearToSrgb(texture2D(cameraTexture, vFaceUv).rgb);
712
- vec4 textureSample = texture2D(canonicalTexture, vUv);
713
- vec3 blend = linearToSrgb(textureSample.rgb) * textureTint;
714
- float light = ambientStrength + max(dot(normalize(vNormal), normalize(lightDirection)), 0.0) * directionalStrength;
715
- blend *= mix(1.0, clamp(light, 0.35, 1.35), compositeShading);
716
- float maskSample = texture2D(alphaMask, vUv).r;
717
- float mask = useAlphaMask > 0.5 ? mix(1.0, maskSample, alphaOpacity) : 1.0;
718
- float textureAlpha = useCanonicalTexture > 0.5 ? textureSample.a : 1.0;
719
- vec3 blended = applyBlendMode(base, blend, blendMode);
720
- vec3 color = useCanonicalTexture > 0.5 ? mix(base, blended, blendOpacity) : base;
721
- gl_FragColor = vec4(srgbToLinear(color), opacity * mask * textureAlpha);
722
- // Blending above runs in sRGB; the result is linear here and three only
723
- // encodes built-in materials, so encode for the output colour space.
724
- #include <colorspace_fragment>
725
- }
726
- `, Wn = ({
727
- alphaMap: e,
728
- alphaOpacity: n,
729
- blendMode: t,
730
- blendOpacity: r,
731
- cameraTexture: a,
732
- color: o,
733
- compositeShading: s,
734
- faceAlphaMaskUrl: l,
735
- faceTextureStyle2Url: f,
736
- faceTextureUrl: d,
737
- masked: i = !1,
738
- maskColor: u,
739
- maskOpacity: c,
740
- maskSourceUrl: p,
741
- maskTextureSource: h,
742
- materialType: A,
743
- opacity: x,
744
- shaderPreset: U,
745
- side: g,
746
- textureMap: b
747
- }) => {
748
- const R = fe(
749
- k.TextureLoader,
750
- d || Me
751
- ), S = fe(
752
- k.TextureLoader,
753
- f || d || Me
754
- ), E = fe(
755
- k.TextureLoader,
756
- l || Me
757
- ), _ = J(() => un(), []), v = J(() => hn(), []);
758
- Fe(
759
- () => () => {
760
- _.dispose(), v.dispose();
761
- },
762
- [v, _]
763
- );
764
- const F = b === j.style2 ? S : R, N = b !== j.none, $ = Le(A, U, b), K = [
765
- "composite-material",
766
- b,
767
- e,
768
- n,
769
- t,
770
- r,
771
- s ? "lit" : "flat",
772
- o,
773
- x,
774
- d,
775
- f,
776
- l
777
- ].join("|"), L = {
778
- side: g,
779
- transparent: !0,
780
- opacity: x,
781
- wireframe: !1
782
- }, he = J(
783
- () => ({
784
- source: Ue(h) ? "texture" : h,
785
- color: zn(h) ? u : "#ffffff",
786
- opacity: c,
787
- textureUrl: Ue(h) ? p : "",
788
- gradient: rt(u)
789
- }),
790
- [u, c, p, h]
791
- ), w = J(
792
- () => ({
793
- cameraTexture: { value: null },
794
- canonicalTexture: { value: null },
795
- alphaMask: { value: null },
796
- textureTint: { value: new k.Color(o) },
797
- opacity: { value: x },
798
- blendMode: { value: Ze[t] },
799
- blendOpacity: { value: r },
800
- useCanonicalTexture: { value: N ? 1 : 0 },
801
- useAlphaMask: { value: e === ee.canonical ? 1 : 0 },
802
- alphaOpacity: { value: n },
803
- compositeShading: { value: s ? 1 : 0 },
804
- lightDirection: { value: new k.Vector3(0.3, 0.65, 0.7).normalize() },
805
- ambientStrength: { value: 0.78 },
806
- directionalStrength: { value: 0.38 }
807
- }),
808
- [
809
- e,
810
- n,
811
- t,
812
- r,
813
- o,
814
- s,
815
- N,
816
- x
817
- ]
818
- );
819
- if (Fe(() => {
820
- w.cameraTexture.value = a ?? R, w.canonicalTexture.value = F, w.alphaMask.value = E, w.textureTint.value.set(o), w.opacity.value = x, w.blendMode.value = Ze[t], w.blendOpacity.value = r, w.useCanonicalTexture.value = N ? 1 : 0, w.useAlphaMask.value = e === ee.canonical ? 1 : 0, w.alphaOpacity.value = n, w.compositeShading.value = s ? 1 : 0;
821
- }, [
822
- e,
823
- E,
824
- n,
825
- t,
826
- r,
827
- a,
828
- o,
829
- s,
830
- w,
831
- R,
832
- N,
833
- x,
834
- F
835
- ]), i)
836
- return /* @__PURE__ */ M(
837
- Sn,
838
- {
839
- settings: he,
840
- side: g
841
- },
842
- `masked-${h}-material`
843
- );
844
- if (A === C.wireframe)
845
- return /* @__PURE__ */ M(
846
- "meshBasicMaterial",
847
- {
848
- color: o,
849
- transparent: !0,
850
- opacity: x,
851
- side: g,
852
- depthWrite: !1,
853
- depthTest: !1,
854
- wireframe: !0,
855
- toneMapped: !1
856
- },
857
- "wireframe-material"
858
- );
859
- if ($ === "originalFace" && a)
860
- return /* @__PURE__ */ M(
861
- "meshBasicMaterial",
862
- {
863
- map: a,
864
- alphaMap: E,
865
- transparent: !0,
866
- opacity: x,
867
- side: g,
868
- depthWrite: !1,
869
- depthTest: !0,
870
- toneMapped: !1
871
- },
872
- "use-original-face-material"
873
- );
874
- if ($ === "composite" && a)
875
- return /* @__PURE__ */ M(
876
- "shaderMaterial",
877
- {
878
- uniforms: w,
879
- vertexShader: Hn,
880
- fragmentShader: Bn,
881
- transparent: !0,
882
- side: g,
883
- depthWrite: !1,
884
- depthTest: !0,
885
- toneMapped: !1
886
- },
887
- K
888
- );
889
- const Z = N ? F : null, Y = e === ee.canonical && n > 0 ? E : null, X = `${A}-${b}-${e}-${n > 0 ? "alpha-on" : "alpha-off"}`;
890
- return A === C.standard ? /* @__PURE__ */ M(
891
- "meshStandardMaterial",
892
- {
893
- ...L,
894
- color: o,
895
- map: Z ?? void 0,
896
- alphaMap: Y ?? void 0,
897
- depthWrite: !0,
898
- depthTest: !0,
899
- metalness: 0.05,
900
- roughness: 0.72
901
- },
902
- X
903
- ) : A === C.physical ? /* @__PURE__ */ M(
904
- "meshPhysicalMaterial",
905
- {
906
- ...L,
907
- color: o,
908
- map: Z ?? void 0,
909
- alphaMap: Y ?? void 0,
910
- depthWrite: !0,
911
- depthTest: !0,
912
- roughness: 0.58,
913
- metalness: 0.08,
914
- clearcoat: 0.35,
915
- clearcoatRoughness: 0.4
916
- },
917
- X
918
- ) : A === C.toon ? /* @__PURE__ */ M(
919
- "meshToonMaterial",
920
- {
921
- ...L,
922
- color: o,
923
- map: Z ?? void 0,
924
- alphaMap: Y ?? void 0,
925
- gradientMap: _,
926
- depthWrite: !0,
927
- depthTest: !0
928
- },
929
- X
930
- ) : A === C.normal ? /* @__PURE__ */ M(
931
- "meshNormalMaterial",
932
- {
933
- ...L,
934
- depthWrite: !0,
935
- depthTest: !0,
936
- flatShading: !1
937
- },
938
- "normal-material"
939
- ) : A === C.matcap ? /* @__PURE__ */ M(
940
- "meshMatcapMaterial",
941
- {
942
- ...L,
943
- color: o,
944
- matcap: v,
945
- depthWrite: !0,
946
- depthTest: !0
947
- },
948
- "matcap-material"
949
- ) : /* @__PURE__ */ M(
950
- "meshBasicMaterial",
951
- {
952
- ...L,
953
- color: o,
954
- map: Z ?? void 0,
955
- alphaMap: Y ?? void 0,
956
- depthWrite: !1,
957
- depthTest: b !== j.none || e !== ee.none,
958
- toneMapped: !1
959
- },
960
- X
961
- );
962
- }, Xn = [
963
- {
964
- key: "base",
965
- getIndices: (e) => e.baseIndices,
966
- masked: !1,
967
- renderOrderOffset: 0
968
- },
969
- {
970
- key: "mouth",
971
- getIndices: (e) => e.mouthIndices,
972
- masked: !1,
973
- renderOrderOffset: 2
974
- },
975
- {
976
- key: "lips",
977
- getIndices: (e) => e.lipIndices,
978
- masked: !1,
979
- renderOrderOffset: 3
980
- },
981
- {
982
- key: "left-eye",
983
- getIndices: (e) => e.leftEyeIndices,
984
- masked: !1,
985
- renderOrderOffset: 2
986
- },
987
- {
988
- key: "right-eye",
989
- getIndices: (e) => e.rightEyeIndices,
990
- masked: !1,
991
- renderOrderOffset: 2
992
- },
993
- {
994
- key: "nose",
995
- getIndices: (e) => e.noseIndices,
996
- masked: !1,
997
- renderOrderOffset: 2
998
- },
999
- {
1000
- key: "mouth-mask",
1001
- getIndices: (e) => e.mouthIndices,
1002
- masked: !0,
1003
- renderOrderOffset: 3
1004
- },
1005
- {
1006
- key: "left-eye-mask",
1007
- getIndices: (e) => e.leftEyeIndices,
1008
- masked: !0,
1009
- renderOrderOffset: 3
1010
- },
1011
- {
1012
- key: "right-eye-mask",
1013
- getIndices: (e) => e.rightEyeIndices,
1014
- masked: !0,
1015
- renderOrderOffset: 3
1016
- },
1017
- {
1018
- key: "nose-mask",
1019
- getIndices: (e) => e.noseIndices,
1020
- masked: !0,
1021
- renderOrderOffset: 3
1022
- }
1023
- ], Vn = {
1024
- [oe.front]: k.FrontSide,
1025
- [oe.back]: k.BackSide,
1026
- [oe.double]: k.DoubleSide
1027
- }, jn = (e) => ({
1028
- position: new k.BufferAttribute(new Float32Array(e.vertexCount * 3), 3),
1029
- uv: new k.BufferAttribute(new Float32Array(e.uvs), 2),
1030
- faceUv: new k.BufferAttribute(new Float32Array(e.vertexCount * 2), 2),
1031
- lipEdge: new k.BufferAttribute(new Float32Array(e.lipEdgeDistance), 1)
1032
- }), $n = (e, n, t) => {
1033
- e.setAttribute("position", n.position), e.setAttribute("uv", n.uv), e.setAttribute("faceUv", n.faceUv), e.setAttribute("lipEdge", n.lipEdge), e.setIndex(new k.BufferAttribute(t, 1));
1034
- }, Kn = ({
1035
- faceIndex: e = 0,
1036
- baseColor: n,
1037
- color: t = P.baseColor,
1038
- opacity: r = P.opacity,
1039
- materialType: a = P.materialType,
1040
- shaderPreset: o = P.shaderPreset,
1041
- textureMap: s = P.textureMap,
1042
- alphaMap: l = P.alphaMap,
1043
- alphaOpacity: f = P.alphaOpacity,
1044
- side: d = P.side,
1045
- blendMode: i = P.blendMode,
1046
- blendOpacity: u = P.blendOpacity,
1047
- showOverlayMask: c = !1,
1048
- showMouthMask: p = ke.mouth,
1049
- showEyeMask: h = ke.eyes,
1050
- showLeftEyeMask: A,
1051
- showRightEyeMask: x,
1052
- showNoseMask: U = ke.nose,
1053
- showEyeGeometry: g = !0,
1054
- showLeftEyeGeometry: b,
1055
- showRightEyeGeometry: R,
1056
- showMouthGeometry: S = !0,
1057
- // The lips mesh is an effect-only overlay. Rendering it with the base face
1058
- // mesh duplicates an incomplete triangulation over the mouth.
1059
- showLipsGeometry: E = !1,
1060
- showBaseGeometry: _ = !0,
1061
- showNoseGeometry: v = !0,
1062
- maskTextureSource: F = te.textureSource,
1063
- maskSourceUrl: N = "",
1064
- maskColor: $ = te.color,
1065
- maskOpacity: K = te.opacity,
1066
- faceTextureUrl: L = "",
1067
- faceTextureStyle2Url: he = "",
1068
- faceAlphaMaskUrl: w = "",
1069
- compositeShading: Z = !1,
1070
- faceWarp3D: Y,
1071
- transform: X,
1072
- renderOrder: lt = it,
1073
- externalScale: me = 1,
1074
- mesh: dt,
1075
- meshUrl: ft,
1076
- materialOverride: ne,
1077
- maxUpdateFps: ut,
1078
- holdMs: De = 250,
1079
- predictMs: Pe = 0
1080
- }) => {
1081
- const pe = on(rn.FACE_TRACKER), Ne = sn(), { camera: ht } = Zt(), G = Dn({ mesh: dt, url: ft }), Ge = m(null), mt = m(null), pt = m(null), yt = m(null), gt = m(null), bt = m(null), Et = m(null), Mt = m(null), xt = m(null), vt = m(null), At = m(null), St = m(null), Tt = m(null), Rt = m(null), _t = m(null), Ct = m(null), kt = m(null), Ft = m(null), wt = m(null), Ut = m(null), I = J(
1082
- () => G ? jn(G) : null,
1083
- [G]
1084
- ), ze = m(null), He = m(-1 / 0), ie = m(null);
1085
- ie.current || (ie.current = new an({ holdMs: De, predictMs: Pe })), ie.current.setOptions({ holdMs: De, predictMs: Pe });
1086
- const It = m(new k.Vector3()), Ot = m({ x: 0, y: 0, z: 0 }), Lt = m({ x: 0, y: 0, z: 0 }), Dt = m({ x: 0, y: 0, z: 0 }), le = m(!1), Pt = Vn[d], Nt = n ?? t, Gt = b ?? g, zt = R ?? g, Ht = c || (A ?? h), Bt = c || (x ?? h), Wt = c || p, Xt = c || U, Vt = {
1087
- base: Ge,
1088
- mouth: mt,
1089
- lips: pt,
1090
- "left-eye": yt,
1091
- "right-eye": gt,
1092
- nose: bt,
1093
- "mouth-mask": Et,
1094
- "left-eye-mask": Mt,
1095
- "right-eye-mask": xt,
1096
- "nose-mask": vt
1097
- }, jt = {
1098
- base: At,
1099
- mouth: St,
1100
- lips: Tt,
1101
- "left-eye": Rt,
1102
- "right-eye": _t,
1103
- nose: Ct,
1104
- "mouth-mask": kt,
1105
- "left-eye-mask": Ft,
1106
- "right-eye-mask": wt,
1107
- "nose-mask": Ut
1108
- }, $t = {
1109
- base: _,
1110
- mouth: S,
1111
- lips: E,
1112
- "left-eye": Gt,
1113
- "right-eye": zt,
1114
- nose: v,
1115
- "mouth-mask": Wt,
1116
- "left-eye-mask": Ht,
1117
- "right-eye-mask": Bt,
1118
- "nose-mask": Xt
1119
- }, Kt = (T) => /* @__PURE__ */ M(
1120
- Wn,
1121
- {
1122
- alphaMap: l,
1123
- alphaOpacity: f,
1124
- blendMode: i,
1125
- blendOpacity: u,
1126
- cameraTexture: Ne,
1127
- color: Nt,
1128
- compositeShading: Z,
1129
- faceAlphaMaskUrl: w,
1130
- faceTextureStyle2Url: he,
1131
- faceTextureUrl: L,
1132
- masked: T,
1133
- maskColor: $,
1134
- maskOpacity: K,
1135
- maskSourceUrl: N,
1136
- maskTextureSource: F,
1137
- materialType: a,
1138
- opacity: r,
1139
- shaderPreset: o,
1140
- side: Pt,
1141
- textureMap: s
1142
- }
1143
- ), q = Xn.map(
1144
- (T) => ({
1145
- ...T,
1146
- geometryRef: Vt[T.key],
1147
- meshRef: jt[T.key],
1148
- visible: $t[T.key]
1149
- })
1150
- ), Yt = (T) => dn(T, ht, It.current);
1151
- return en((T) => {
1152
- var je, $e;
1153
- const B = Ge.current, re = ($e = (je = pe == null ? void 0 : pe.detectionResults) == null ? void 0 : je.faceLandmarks) == null ? void 0 : $e[e], qt = q.every(
1154
- (y) => y.geometryRef.current && y.meshRef.current
1155
- );
1156
- if (!G || !I || !B || !qt) return;
1157
- const z = ie.current.update(
1158
- [re ?? []],
1159
- T.clock.elapsedTime * 1e3
1160
- )[0];
1161
- if (!z || z.length < G.vertexCount) {
1162
- q.forEach((y) => {
1163
- y.meshRef.current.visible = !1;
1164
- });
1165
- return;
1166
- }
1167
- if ((ze.current !== G || q.some((y) => !y.geometryRef.current.index)) && (q.forEach((y) => {
1168
- $n(y.geometryRef.current, I, y.getIndices(G));
1169
- }), I.uv.needsUpdate = !0, I.lipEdge.needsUpdate = !0, ze.current = G, le.current = !1), cn(T.clock.elapsedTime, He.current, ut)) return;
1170
- He.current = T.clock.elapsedTime;
1171
- const ye = I.position.array, Be = I.faceUv.array, ge = I.uv.array, We = Gn(a, o, s), Xe = Rn(Y), Ve = Xe ? Tn(z) : null, D = X ? Dt.current : null;
1172
- if (D) {
1173
- D.x = 0, D.y = 0, D.z = 0;
1174
- for (let y = 0; y < z.length; y++) {
1175
- const H = z[y];
1176
- D.x += H.x, D.y += H.y, D.z += H.z;
1177
- }
1178
- D.x /= z.length, D.y /= z.length, D.z /= z.length;
1179
- }
1180
- const Jt = Math.min(z.length, G.vertexCount);
1181
- for (let y = 0; y < Jt; y++) {
1182
- const H = z[y], Ke = Xe && Ve ? _n(H, Ve, Y, Ot.current) : H, Qt = X && D ? ln(
1183
- Ke,
1184
- D,
1185
- X,
1186
- Lt.current
1187
- ) : Ke, be = y * 3, de = y * 2, Ee = Yt(Qt);
1188
- ye[be] = Ee.x, ye[be + 1] = Ee.y, ye[be + 2] = Ee.z, Be[de] = H.x, Be[de + 1] = 1 - H.y, We && (ge[de] = H.x, ge[de + 1] = 1 - H.y);
1189
- }
1190
- We ? (B.attributes.uv.needsUpdate = !0, le.current = !0) : le.current && (ge.set(G.uvs), B.attributes.uv.needsUpdate = !0, le.current = !1), q.forEach((y) => {
1191
- y.meshRef.current.visible = y.visible;
1192
- }), B.attributes.position.needsUpdate = !0, B.attributes.faceUv.needsUpdate = !0, q.forEach((y) => {
1193
- y.geometryRef.current.computeVertexNormals();
1194
- });
1195
- }), /* @__PURE__ */ M("group", { scale: [me, me, me], children: q.map((T) => {
1196
- const B = ne ? typeof ne == "function" ? ne({
1197
- cameraTexture: Ne ?? null,
1198
- geometryKey: T.key,
1199
- faceUv: (I == null ? void 0 : I.faceUv) ?? null,
1200
- lipEdge: (I == null ? void 0 : I.lipEdge) ?? null
1201
- }) : ne : void 0, re = B instanceof k.Material ? B : void 0;
1202
- return /* @__PURE__ */ Ie(
1203
- "mesh",
1204
- {
1205
- ref: T.meshRef,
1206
- renderOrder: lt + T.renderOrderOffset,
1207
- frustumCulled: !1,
1208
- material: re,
1209
- children: [
1210
- /* @__PURE__ */ M("bufferGeometry", { ref: T.geometryRef }),
1211
- re ? null : ne ? B : Kt(T.masked)
1212
- ]
1213
- },
1214
- `${T.key}:${re ? "instance" : "node"}`
1215
- );
1216
- }) });
1217
- }, Yn = `${se.sdkAssetsBaseUrl}/Canonical_Face_Color.png`, qn = `${se.sdkAssetsBaseUrl}/Canonical_Face_Color_style_2.png`, Jn = `${se.sdkAssetsBaseUrl}/Canonical_Face_Color_Mask.png`, Qn = {
1218
- ...Je,
1219
- position: { ...Je.position, y: 1e-3 }
1220
- }, pr = {
1221
- enabled: !0,
1222
- faceIndex: 0,
1223
- targetFps: Nn,
1224
- ...P,
1225
- showLeftEyeGeometry: !0,
1226
- showRightEyeGeometry: !0,
1227
- showMouthGeometry: !0,
1228
- showNoseGeometry: !0,
1229
- externalScale: 1,
1230
- showOverlayMask: !1,
1231
- showMouthMask: !1,
1232
- showLeftEyeMask: !1,
1233
- showRightEyeMask: !1,
1234
- showNoseMask: !1,
1235
- maskTextureSource: te.textureSource,
1236
- maskSourceUrl: "",
1237
- maskColor: te.color,
1238
- maskOpacity: te.opacity,
1239
- faceTextureUrl: Yn,
1240
- faceTextureStyle2Url: qn,
1241
- faceAlphaMaskUrl: Jn,
1242
- renderOrder: it
1243
- }, Zn = (e) => {
1244
- const { externalMeshUrl: n, ...t } = e;
1245
- return { ...t, color: t.baseColor, meshUrl: n };
1246
- }, er = ({
1247
- materialOverride: e,
1248
- value: n
1249
- }) => ({
1250
- ...Zn(n),
1251
- materialOverride: e
1252
- }), yr = (e, n) => {
1253
- const t = { ...e, ...n };
1254
- return n.maskTextureSource && !Ue(n.maskTextureSource) && (t.maskSourceUrl = ""), t.materialType === C.shader && n.shaderPreset === V.composite ? {
1255
- ...t,
1256
- ...Qe,
1257
- materialType: C.shader,
1258
- shaderPreset: V.composite
1259
- } : t.materialType === C.shader && t.shaderPreset === V.composite && t.textureMap === j.none ? {
1260
- ...t,
1261
- textureMap: Qe.textureMap
1262
- } : t;
1263
- }, gr = ({ transform: e, value: n, materialOverride: t }) => n.enabled ? /* @__PURE__ */ Ie(et, { children: [
1264
- /* @__PURE__ */ M(
1265
- fn,
1266
- {
1267
- active: n.enabled,
1268
- faceIndex: n.faceIndex,
1269
- numFaces: n.faceIndex + 1,
1270
- targetFps: n.targetFps
1271
- }
1272
- ),
1273
- /* @__PURE__ */ M(
1274
- Kn,
1275
- {
1276
- ...er({ value: n, materialOverride: t }),
1277
- transform: e ?? Qn
1278
- }
1279
- )
1280
- ] }) : null;
1281
- export {
1282
- Q as A,
1283
- gn as B,
1284
- at as C,
1285
- P as D,
1286
- Je as E,
1287
- C as F,
1288
- fr as G,
1289
- rt as H,
1290
- we as I,
1291
- zn as J,
1292
- Ue as K,
1293
- Sn as M,
1294
- xn as S,
1295
- ur as T,
1296
- V as a,
1297
- oe as b,
1298
- j as c,
1299
- ee as d,
1300
- ct as e,
1301
- ce as f,
1302
- Oe as g,
1303
- Kn as h,
1304
- Ze as i,
1305
- pr as j,
1306
- Qn as k,
1307
- ke as l,
1308
- mr as m,
1309
- Wn as n,
1310
- gr as o,
1311
- Jn as p,
1312
- qn as q,
1313
- Yn as r,
1314
- hr as s,
1315
- Xn as t,
1316
- Dn as u,
1317
- er as v,
1318
- Zn as w,
1319
- yr as x,
1320
- Un as y,
1321
- pn as z
1322
- };