@vincentt-xr/sdk 2.0.0-alpha.2 → 2.0.0-alpha.20
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.
- package/GROUNDING.md +6798 -84
- package/README.md +86 -52
- package/components.json +223 -0
- package/dist/CanonicalHeadFrame-CQe2YX9a.js +1506 -0
- package/dist/CanonicalHeadFrame-CZFvPzN_.cjs +1 -0
- package/dist/DebuggerUI-CKYrYmod.js +275 -0
- package/dist/DebuggerUI-Db-1VtQJ.cjs +1 -0
- package/dist/FaceRetouch-DHhn1nSV.cjs +134 -0
- package/dist/FaceRetouch-l7y4oZBu.js +1071 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/Scenes--qAbN6iP.cjs +1 -0
- package/dist/Scenes-icIQpHtV.js +58 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-C-AibH5A.cjs +2 -0
- package/dist/TextLabel-fEF1o3wE.js +963 -0
- package/dist/assets/cache.d.ts +99 -0
- package/dist/assets/estimate.d.ts +11 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/loaders.d.ts +43 -0
- package/dist/assets/react.d.ts +33 -0
- package/dist/assets/sdkModels.d.ts +22 -0
- package/dist/audio/AudioPlayer.d.ts +4 -1
- package/dist/body/__fixtures__/syntheticRig.d.ts +21 -0
- package/dist/body/bodyFlipGuard.d.ts +39 -0
- package/dist/body/bodyIdentity.d.ts +72 -0
- package/dist/body/bodyMask.d.ts +79 -0
- package/dist/body/bodyMaskMaterial.d.ts +15 -0
- package/dist/body/bodyPose.d.ts +58 -0
- package/dist/body/bodyRigFit.d.ts +148 -0
- package/dist/body/bodyRigSolver.d.ts +114 -0
- package/dist/body/bodySubject.d.ts +46 -0
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/bodyMaskMaterial-BOdSJUEM.js +207 -0
- package/dist/bodyMaskMaterial-Q6rYywwW.cjs +68 -0
- package/dist/cache-DFqZYsHC.cjs +1 -0
- package/dist/cache-Mu-VO_6E.js +212 -0
- package/dist/calibration/calibration.d.ts +75 -0
- package/dist/calibration/index.d.ts +6 -0
- package/dist/calibration/storage.d.ts +13 -0
- package/dist/calibration/types.d.ts +53 -0
- package/dist/calibration/useXRCalibration.d.ts +46 -0
- package/dist/camera/CameraPermissionGate.d.ts +26 -0
- package/dist/camera/devices.d.ts +26 -0
- package/dist/camera/index.d.ts +8 -0
- package/dist/camera/permission.d.ts +86 -0
- package/dist/camera/useCameraPermission.d.ts +35 -0
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/capabilities/detect.d.ts +45 -0
- package/dist/capabilities/index.d.ts +5 -0
- package/dist/capabilities/types.d.ts +120 -0
- package/dist/capabilities/useXRCapabilities.d.ts +18 -0
- package/dist/compat/environment.d.ts +5 -0
- package/dist/compat/index.d.ts +4 -0
- package/dist/compat/run.d.ts +18 -0
- package/dist/compat/scenarios.d.ts +10 -0
- package/dist/compat/types.d.ts +101 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +76 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +30 -0
- package/dist/components/BodyRig/BodyAttachment.d.ts +28 -0
- package/dist/components/BodyRig/BodyOccluder.d.ts +27 -0
- package/dist/components/BodyRig/bodyDepth.d.ts +57 -0
- package/dist/components/BodyRig/index.d.ts +129 -0
- package/dist/components/BodyRig/useBodyDepthTexture.d.ts +40 -0
- package/dist/components/BodyTracker/index.d.ts +26 -1
- package/dist/components/BodyTrigger/index.d.ts +56 -0
- package/dist/components/Button/index.d.ts +27 -0
- package/dist/components/Button/safeLink.d.ts +6 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +11 -3
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +51 -3
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +22 -1
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +22 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +3 -3
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/GestureListener/index.d.ts +11 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandEffect/index.d.ts +36 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandNails.d.ts +61 -0
- package/dist/components/HandRig/HandOccluder.d.ts +45 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +127 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +96 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HandTracker/index.d.ts +10 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +67 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/HolisticTracker/index.d.ts +69 -0
- package/dist/components/HolisticTracker/settings.d.ts +58 -0
- package/dist/components/HolisticTracker/signals.d.ts +49 -0
- package/dist/components/HtmlRegion/index.d.ts +8 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
- package/dist/components/IrisEffect/index.d.ts +51 -0
- package/dist/components/IrisEffect/settings.d.ts +117 -0
- package/dist/components/Light/index.d.ts +26 -0
- package/dist/components/LipEffect/LipEffect.d.ts +28 -0
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +98 -0
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +51 -0
- package/dist/components/LipEffect/index.d.ts +12 -0
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +375 -0
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +141 -0
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
- package/dist/components/LipEffect/uvGuide.d.ts +74 -0
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/MeshRenderer/index.d.ts +8 -1
- package/dist/components/Model/index.d.ts +16 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/Object3D/index.d.ts +13 -0
- package/dist/components/PaintedFace/index.d.ts +24 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/PersonCutout/index.d.ts +46 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/PersonCutout/personMask.d.ts +19 -0
- package/dist/components/PersonCutout/useBodyMaskTexture.d.ts +35 -0
- package/dist/components/SceneObjectRenderer/index.d.ts +9 -2
- package/dist/components/ScreenImage/ScreenImage.d.ts +4 -1
- package/dist/components/ScreenImage/components/ImageLoadFallback.d.ts +24 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +2 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- package/dist/components/ScreenImage/liveEditable.d.ts +12 -0
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/source.d.ts +9 -0
- package/dist/components/ScreenImage/types.d.ts +48 -3
- package/dist/components/ScreenShape/index.d.ts +4 -1
- package/dist/components/ScreenShape/types.d.ts +13 -0
- package/dist/components/ScreenSpaceUI/index.d.ts +1 -0
- package/dist/components/ScreenText/index.d.ts +4 -1
- package/dist/components/ScreenText/liveEditable.d.ts +6 -0
- package/dist/components/ScreenText/types.d.ts +2 -1
- package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
- package/dist/components/SegmentationOverlay/index.d.ts +9 -0
- package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
- package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
- package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
- package/dist/components/ShoulderOccluder/index.d.ts +46 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +27 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/TextLabel/TextLabel.d.ts +1 -1
- package/dist/components/TextLabel/types.d.ts +150 -37
- package/dist/components/ThemeProvider/index.d.ts +24 -0
- package/dist/components/XRMediaSurface/index.d.ts +2 -1
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
- package/dist/components/index.d.ts +18 -0
- package/dist/components/occluder/skinnedOccluder.d.ts +39 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/constants/index.d.ts +4 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-CSz9stBV.cjs +1 -0
- package/dist/contexts-Cl-4dUOI.js +667 -0
- package/dist/coordinates/feed.d.ts +52 -0
- package/dist/coordinates/index.d.ts +7 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/coordinates/spaces.d.ts +49 -0
- package/dist/coordinates/viewport.d.ts +32 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +19 -4
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/index.d.ts +3 -3
- package/dist/debug-ui/media-source/media-preset.d.ts +12 -0
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +7 -5
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2721 -2531
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/drawNormalizedCrop-D606u5-F.js +135 -0
- package/dist/drawNormalizedCrop-DaGT5mZ5.cjs +1 -0
- package/dist/editor-defs/definitions.d.ts +2 -0
- package/dist/editor-defs/index.d.ts +3 -0
- package/dist/editor-defs/types.d.ts +57 -0
- package/dist/editor-sample/sample.d.ts +15 -0
- package/dist/editor-scenes.cjs +1 -0
- package/dist/editor-scenes.js +59 -0
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +38 -4
- package/dist/entries/editor-scenes.d.ts +8 -0
- package/dist/entries/face-effects.d.ts +125 -7
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +4 -1
- package/dist/entries/low-level.d.ts +83 -2
- package/dist/entries/particles.d.ts +15 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +87 -2
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2324 -1
- package/dist/face-effects.js +14244 -2170
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/footage-input/index.d.ts +46 -0
- package/dist/gestures/definitions.d.ts +98 -0
- package/dist/gestures/detector.d.ts +87 -0
- package/dist/gestures/index.d.ts +8 -0
- package/dist/gestures/measures.d.ts +114 -0
- package/dist/gestures/settings.d.ts +49 -0
- package/dist/getFaceInfo-BbcKq8PJ.cjs +1 -0
- package/dist/getFaceInfo-Mt44zlej.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +190 -0
- package/dist/hand/forearm.d.ts +114 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handEffect.d.ts +38 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handNail.d.ts +73 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/nailImageMask.d.ts +40 -0
- package/dist/hand/nailMaskFingers.d.ts +23 -0
- package/dist/hand/nailTipRefine.d.ts +37 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +77 -4
- package/dist/hooks/useBodies.d.ts +39 -0
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceInfo.d.ts +13 -1
- package/dist/hooks/useFaceInfos.d.ts +1 -1
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useGesture.d.ts +39 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useTrackerContext.d.ts +12 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +12 -0
- package/dist/hooks/useXRSession/facade.d.ts +44 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +21 -0
- package/dist/hooks/useXRSession/registry.d.ts +14 -0
- package/dist/hooks/useXRSession/store.d.ts +64 -7
- package/dist/index-B0EYdofX.js +442 -0
- package/dist/index-BDxJWWyy.js +3814 -0
- package/dist/index-BkjRuUdW.cjs +21 -0
- package/dist/index-Bn72laBn.js +188 -0
- package/dist/index-CM3jkleV.js +1204 -0
- package/dist/index-CbBCl2ZU.js +190 -0
- package/dist/index-CelqbDSR.cjs +1 -0
- package/dist/index-CicO_Tnw.js +240 -0
- package/dist/index-D5NbXaCn.js +1438 -0
- package/dist/index-DIYaENN3.cjs +1 -0
- package/dist/index-DzdKBXGE.cjs +1 -0
- package/dist/index-J3Qy6hi3.cjs +1 -0
- package/dist/index-LC2Xs08E.cjs +1 -0
- package/dist/index-fDwL47CM.cjs +46 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1528 -0
- package/dist/{internal-DuMPpcbp.js → internal-BoFDq5hC.js} +138 -119
- package/dist/internal-DS8Pdlsm.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +16 -9
- package/dist/iris/compute.d.ts +27 -0
- package/dist/iris/index.d.ts +4 -0
- package/dist/iris/lead.d.ts +19 -0
- package/dist/iris/types.d.ts +89 -0
- package/dist/landmarkMask-CvN-L5NT.cjs +1 -0
- package/dist/landmarkMask-DHivVjJm.js +225 -0
- package/dist/landmarks-BP6RbRHN.cjs +1 -0
- package/dist/landmarks-C3LvDhMt.js +76 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1295 -757
- package/dist/main.cjs +1 -1
- package/dist/main.js +1456 -483
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +30 -1
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +4 -12
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Holistic/index.d.ts +49 -0
- package/dist/models/Holistic/result.d.ts +68 -0
- package/dist/models/Segmentation/index.d.ts +6 -3
- package/dist/models/SemanticSegmentation/index.d.ts +31 -0
- package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +71 -0
- package/dist/particles/system.d.ts +66 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +999 -0
- package/dist/product/ProductDimensions.d.ts +16 -0
- package/dist/product/ProductHotspot.d.ts +16 -0
- package/dist/product/ProductViewer.d.ts +9 -0
- package/dist/product/details.d.ts +53 -0
- package/dist/product/index.d.ts +14 -0
- package/dist/product/loadModelViewer.d.ts +4 -0
- package/dist/product/types.d.ts +71 -0
- package/dist/product/useProductAr.d.ts +37 -0
- package/dist/product/useProductDetails.d.ts +60 -0
- package/dist/product.cjs +1 -0
- package/dist/product.js +414 -0
- package/dist/providers-BRSbw214.cjs +62 -0
- package/dist/providers-Bxt_MfPK.js +424 -0
- package/dist/quality/XRQualityController.d.ts +25 -0
- package/dist/quality/controller.d.ts +33 -0
- package/dist/quality/index.d.ts +6 -0
- package/dist/quality/types.d.ts +100 -0
- package/dist/quality/useXRQuality.d.ts +28 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-Dvm1J4lW.cjs → renderGroups-B0N58SIA.cjs} +1 -1
- package/dist/{renderGroups-C9QJrAXu.js → renderGroups-uYPzUa66.js} +1 -1
- package/dist/renderPasses-Bt8k0dkm.cjs +158 -0
- package/dist/renderPasses-C0wu5Cwg.js +1290 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/scenes/Scenes.d.ts +47 -0
- package/dist/scenes/edit.d.ts +37 -0
- package/dist/scenes/navigate.d.ts +5 -0
- package/dist/screen2d/coordinates.d.ts +57 -0
- package/dist/screen2d/screenTransform.d.ts +13 -0
- package/dist/segmentation-Cz7oeNcS.cjs +1 -0
- package/dist/segmentation-DccvYBBO.js +1911 -0
- package/dist/segmentation2d/faceMemory.d.ts +28 -0
- package/dist/segmentation2d/faceRegions.d.ts +24 -0
- package/dist/segmentation2d/index.d.ts +9 -0
- package/dist/segmentation2d/maskUv.d.ts +23 -0
- package/dist/segmentation2d/rasterize.d.ts +14 -0
- package/dist/segmentation2d/types.d.ts +52 -0
- package/dist/selectors-Bq6tSgOY.cjs +1 -0
- package/dist/selectors-J06V0eDb.js +196 -0
- package/dist/session-3aCMNb8W.cjs +31 -0
- package/dist/session-CYiWfcvz.js +493 -0
- package/dist/settings-BJ7FMBsO.js +111 -0
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/subjects/index.d.ts +2 -0
- package/dist/subjects/select.d.ts +70 -0
- package/dist/subjects/types.d.ts +59 -0
- package/dist/texture/animatedTexture.d.ts +2 -0
- package/dist/texture/gifReader.d.ts +17 -0
- package/dist/texture/gifTextureSource.d.ts +16 -0
- package/dist/textures-BVwo9Z7z.js +38 -0
- package/dist/textures-DAfc61zz.cjs +1 -0
- package/dist/tracking/coordinates.d.ts +5 -0
- package/dist/tracking-config/apply.d.ts +57 -0
- package/dist/tracking-config/index.d.ts +7 -0
- package/dist/tracking-config/resolve.d.ts +25 -0
- package/dist/tracking-config/storage.d.ts +8 -0
- package/dist/tracking-config/types.d.ts +106 -0
- package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1439 -486
- package/dist/trigger-CQviD4xp.js +3726 -0
- package/dist/trigger-UjeJY5uh.cjs +147 -0
- package/dist/types/common.d.ts +11 -1
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/gesture-tracking.d.ts +2 -2
- package/dist/types/hand-tracking.d.ts +12 -3
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +79 -5
- package/dist/types/segmentation.d.ts +26 -0
- package/dist/types/session.d.ts +48 -4
- package/dist/useBodies-CXomEo0i.cjs +1 -0
- package/dist/useBodies-DOuwRuew.js +75 -0
- package/dist/useEditOverrides-BBkK8cN2.js +41 -0
- package/dist/useEditOverrides-CgapHJzA.cjs +1 -0
- package/dist/useFaceInfo-BEMMiZxw.cjs +1 -0
- package/dist/useFaceInfo-XUGYTdfN.js +75 -0
- package/dist/useFaceResultReader-D8wXbF1L.js +61 -0
- package/dist/useFaceResultReader-D9qibKmm.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useIrisTracking-B0uLWgNE.js +6190 -0
- package/dist/useIrisTracking-DExhnhlt.cjs +35 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-D-EhcDzM.cjs +1 -0
- package/dist/useXRCapabilities-DPUOvpdf.js +30 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +21 -1
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/utils/updateThrottle.d.ts +2 -0
- package/dist/utils/useEditOverrides.d.ts +34 -0
- package/dist/utils/useStableUniforms.d.ts +18 -0
- package/dist/utils/visionWasm.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-BgQAX8rs.js → uv-DJU_XfmN.js} +15 -244
- package/docs/SDK_DOCUMENTATION.md +4 -2
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/body-instructions.mdx +287 -0
- package/docs/api/body-rig.mdx +384 -0
- package/docs/api/body-triggers.mdx +235 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/capture-recording.mdx +9 -1
- package/docs/api/coordinate-spaces.mdx +168 -0
- package/docs/api/cross-camera.mdx +89 -0
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +9 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +18 -12
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +39 -7
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +210 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +661 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +164 -0
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +247 -0
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/multi-subject.mdx +185 -0
- package/docs/api/particles.mdx +183 -0
- package/docs/api/person-cutout.mdx +171 -0
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +114 -0
- package/docs/api/product-details.mdx +78 -0
- package/docs/api/runtime-3d.mdx +5 -0
- package/docs/api/screen-image.mdx +29 -3
- package/docs/api/screen-space-coordinates.mdx +43 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +165 -0
- package/docs/api/texture-sources.mdx +25 -6
- package/docs/api/trackers.mdx +20 -1
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +52 -1
- package/docs/examples/lip-shaders.mdx +273 -0
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +4 -4
- package/docs/guides/lip-effect-textures.mdx +368 -0
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -0
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/docs/texture-api-consumer.md +26 -0
- package/package.json +44 -5
- package/settings.json +2152 -0
- package/dist/DebuggerUI-B45_Gb9d.cjs +0 -1
- package/dist/DebuggerUI-Cq28c18s.js +0 -269
- package/dist/FaceMeshRenderer-6t8OsQhK.js +0 -1195
- package/dist/FaceMeshRenderer-lQLhYIW-.cjs +0 -155
- package/dist/FaceRetouch-CDrL0pXg.js +0 -551
- package/dist/FaceRetouch-DtNl8-4e.cjs +0 -134
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-BKvTIayr.cjs +0 -1
- package/dist/contexts-Bk5zz_VR.js +0 -214
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/drawNormalizedCrop-B-7zU-Xw.cjs +0 -1
- package/dist/drawNormalizedCrop-CRdIDyl1.js +0 -44
- package/dist/getFaceInfo-CyPAKh3h.cjs +0 -1
- package/dist/getFaceInfo-hUKMLFcr.js +0 -118
- package/dist/index-82aENaRq.cjs +0 -1
- package/dist/index-CEc1CAmB.cjs +0 -1
- package/dist/index-CTHeBQOs.js +0 -178
- package/dist/index-D4bLzBr6.cjs +0 -1
- package/dist/index-DSpzjuqd.cjs +0 -1
- package/dist/index-Di70KWuY.js +0 -2049
- package/dist/index-DzEzkBIH.cjs +0 -17
- package/dist/index-JygePOwo.js +0 -1398
- package/dist/index-UC0Ux38E.js +0 -111
- package/dist/internal-i2JkM85N.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-CT5iBwtg.cjs +0 -21
- package/dist/renderPasses-CjgG_6kQ.js +0 -1500
- package/dist/selectors-2QvO5RYY.cjs +0 -1
- package/dist/selectors-Dw3C-gSk.js +0 -59
- package/dist/session-BChR4TgK.cjs +0 -31
- package/dist/session-C1StwN0f.js +0 -363
- package/dist/useFaceInfo-C-WfMlYp.cjs +0 -1
- package/dist/useFaceInfo-CwsHZedC.js +0 -62
- package/dist/useFaceResults-CkFc1egZ.js +0 -19
- package/dist/useFaceResults-VcFdOUFV.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const T=require("react/jsx-runtime"),I=require("react"),q=require("@react-three/fiber"),M=require("three"),l=require("./index-J3Qy6hi3.cjs"),w=require("./index-DIYaENN3.cjs"),G=require("./selectors-Bq6tSgOY.cjs"),b=require("./similarityFit-BFqHND2e.cjs"),F=require("./useLandmarkPoseFit-Bg-h9BPb.cjs");function h(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const C=h(M),k=Float32Array.from([0,-3.4064,5.97951,0,-1.12686,7.4756,0,-2.08902,6.05827,-.46393,.95536,6.63358,0,-.46317,7.58658,0,.36567,7.24287,0,2.47326,5.78863,-4.25308,2.57765,3.2797,0,4.01904,5.28476,0,4.88598,5.38526,0,8.26178,4.48153,0,-3.70681,5.86492,0,-3.9183,5.56943,0,-3.99444,5.21948,0,-4.5424,5.40475,0,-4.74558,5.52946,0,-5.01957,5.60145,0,-5.36512,5.53544,0,-6.14962,5.07137,0,-1.50109,7.1122,-.41611,-1.46645,6.44766,-7.08796,5.4348,.09962,-2.62864,2.0359,3.84812,-3.19836,1.98582,3.79695,-3.77515,2.0394,3.64619,-4.46582,2.42295,3.15517,-2.16429,2.18987,3.85182,-3.20823,3.22393,4.11582,-2.6738,3.20534,4.0922,-3.74519,3.16529,3.97241,-4.16102,3.05907,3.71955,-5.06201,1.93442,2.77609,-2.26666,-7.42577,4.38981,-4.44586,2.66399,3.17342,-7.21453,2.26301,.07315,-5.79979,2.34955,2.20406,-2.84494,-.72087,4.43313,-.71145,-3.32935,5.87704,-.60603,-3.92456,5.44492,-1.43161,-3.50095,5.49619,-1.91491,-3.80315,5.02893,-1.13104,-3.97394,5.18965,-1.56355,-4.08276,4.84226,-2.65011,-5.00365,4.18848,-.42705,-1.09413,7.36053,-.4964,-.47566,7.44036,-5.25331,3.88158,3.36316,-1.7187,.97461,4.55836,-1.60863,-.94252,5.81419,-1.65127,-.61087,5.58132,-4.7655,-.70155,3.53463,-.47831,.29577,7.10101,-3.73496,4.50823,4.55045,-4.5886,4.30204,4.04848,-6.27933,6.61543,1.42585,-1.22094,4.14217,5.10603,-2.19349,3.10032,4.00058,-3.10264,-4.35298,4.09591,-6.71968,-4.78864,-1.7454,-1.19382,-1.30679,5.73775,-.72977,-1.59371,5.83321,-2.45621,-4.34262,4.28388,-2.20482,-4.30451,4.1625,-4.98589,4.80246,3.75198,-1.59229,-1.25771,5.45695,-2.64455,4.52465,4.92156,-2.76029,5.10097,5.01599,-3.52396,8.00598,3.72916,-5.59976,5.71547,2.72426,-3.06393,6.56614,4.52998,-5.72097,4.25458,2.83085,-6.37439,4.78559,1.59169,-.67273,-3.68802,5.7378,-1.26256,-3.78769,5.41778,-1.73255,-3.95277,5.00058,-1.04362,-1.46497,5.66246,-2.32123,-4.32907,4.25816,-2.05685,-4.47767,4.52088,-2.15308,-4.27632,4.03809,-.94687,-1.03525,6.51227,-1.46913,-4.03635,4.60491,-1.02434,-3.98985,4.92669,-.53342,-3.99322,5.1382,-.76972,-6.09539,4.98588,-.69961,-5.29185,5.4483,-.66969,-4.94977,5.50961,-.63095,-4.6951,5.44937,-.58322,-4.51798,5.33987,-1.53717,-4.42321,4.74547,-1.6156,-4.47594,4.81363,-1.72905,-4.61868,4.85446,-1.83862,-4.82875,4.82374,-2.36825,-3.10624,4.8681,-7.54224,-1.04928,-2.43132,0,-1.724,6.60139,-1.82661,-4.39953,4.39902,-1.92956,-4.41183,4.49705,-.59744,-2.01369,5.86646,-1.40563,-1.7142,5.24109,-.66245,-1.81932,5.86376,-2.34234,.57222,4.2943,-3.32732,.10486,4.11386,-1.72617,-.91916,5.27336,-5.1332,7.4856,2.66044,-4.53864,6.31991,3.68342,-3.98656,5.10949,4.46631,-2.16968,-5.44043,4.45587,-1.39563,5.01196,5.31603,-1.6195,6.59922,4.92111,-1.8914,8.23638,4.275,-4.19583,2.23521,3.3751,-5.73334,1.41174,2.43173,-1.85989,2.35576,3.84318,-4.98861,3.07465,3.08386,-1.30326,1.41645,4.83109,-1.30576,-.67278,6.41596,-6.46517,.93712,1.68987,-5.25866,.94581,2.97431,-4.43234,.7221,3.52261,-3.30068,.86164,3.87278,-2.43018,1.13149,4.03903,-1.82073,1.46795,4.22412,-.56322,2.30769,5.56679,-6.33814,-.52928,1.88118,-5.5877,3.20807,2.68784,-.24262,-1.46286,7.07149,-1.61125,.33933,4.89542,-7.74309,2.365,-2.00517,-1.39114,1.85105,4.449,-1.78579,-.97828,4.85047,-4.67096,2.66446,3.08407,-1.33397,-.28376,6.09705,-7.2709,-2.89092,-2.25245,-1.85643,2.58525,3.7579,-.92339,.07308,6.67194,-5.00059,-6.13513,1.89252,-5.08528,-7.17859,.71471,-7.15929,-.81182,-.07204,-5.84305,-5.24802,.92409,-6.84726,3.66292,.72469,-2.41294,-8.25885,4.11921,-.17991,-1.68986,6.5733,-2.10366,-.16395,4.56612,-6.40757,2.23602,1.56084,-3.67007,2.36015,3.63523,-3.17719,2.29427,3.7757,-2.19612,-4.59832,4.47979,-6.23488,-1.94443,1.66354,-1.29292,-9.29592,4.09406,-3.21065,-8.53328,2.802,-4.06893,-7.99311,1.92512,0,6.54539,5.02731,0,-9.40338,4.26449,-2.72403,2.3158,3.77715,-2.28846,2.39889,3.6976,-1.99831,2.49655,3.68915,-6.13004,3.39926,2.03852,-2.28846,2.8865,3.77503,-2.72403,2.96181,3.87177,-3.17719,2.96414,3.87697,-3.67007,2.92771,3.72432,-4.01839,2.85736,3.48298,-7.55581,4.10681,-.99192,-4.01839,2.4837,3.4409,0,-2.52194,5.93226,-1.77622,-2.68395,5.21312,-1.22224,-1.18244,5.95247,-.73149,-2.53668,5.81534,0,3.27103,5.23601,-4.13527,-6.99664,2.67197,-3.31181,-7.66081,3.38296,-1.3137,-8.63999,4.70246,-5.94052,-6.22363,-.63147,-1.99831,2.74384,3.74403,-.90145,1.23699,5.75426,0,-8.76524,4.89144,-2.30898,-8.9742,3.60907,-6.95415,-2.43984,-.13116,-1.09882,-4.45879,5.12073,-1.18112,-4.58,5.18956,-1.25582,-4.7879,5.23705,-1.32509,-5.10651,5.20501,-1.54639,-5.81939,4.75789,-1.95375,-4.18389,4.43171,-2.1178,-4.13709,4.5551,-2.28534,-4.0512,4.58244,-2.85016,-3.66572,4.48499,-5.27854,-2.23894,2.86122,-.94671,1.90763,5.19678,-1.31417,3.10491,4.2314,-1.78,2.86,3.88155,-1.84511,-4.09888,4.24726,-5.43619,-4.03048,2.10985,-.76644,3.18213,4.86145,-1.93862,-6.61441,4.52109,0,1.05941,6.7746,-.51657,1.58357,6.14836,0,1.72837,6.31675,-1.24681,.2303,5.68104,0,-7.94219,5.18117,0,-6.9915,5.15348,-.99783,-6.93092,4.97958,-3.28881,-5.38251,3.79575,-2.31163,-1.56624,4.59009,-2.68025,-6.11157,4.09615,-3.83293,-1.53733,4.13773,-2.96186,-2.27421,4.44094,-4.3869,-2.68329,3.64389,-1.2173,-7.83446,4.96929,-1.54237,-.13684,5.20101,-3.87838,-6.04176,3.31108,-3.08404,-6.80984,3.8142,-3.74732,-4.50354,3.72645,-6.09413,-3.20599,1.47348,-4.58899,-4.72873,2.98322,-6.58323,-3.94127,.07027,-3.49258,-3.19582,4.1302,-1.25554,.80234,5.30755,-1.12612,-.9336,6.53878,-1.44311,-1.14277,5.90513,-.92304,-.52904,7.00342,-1.75539,3.52912,4.3277,-2.63259,3.71383,4.36463,-3.38806,3.72198,4.30903,-4.07577,3.67541,4.07606,-4.62291,3.47469,3.64632,-5.17175,2.53575,2.67087,-7.29733,.76317,-.04877,-4.70683,1.651,3.10953,-4.07171,1.47682,3.47694,-3.26982,1.47066,3.73195,-2.52757,1.61731,3.86544,-1.97089,1.85851,3.96178,-1.57954,2.09794,4.085,-7.66418,.67313,-2.43587,-1.39704,-1.34014,5.63038,-.88484,.65874,6.23323,-.7671,-.96803,7.07793,-.46021,-1.33411,6.78745,-.74862,-1.06799,6.7983,-1.23641,-1.58557,5.48049,-.38731,-1.40999,6.95771,-.31993,-1.60793,6.50868,-1.63963,2.5563,3.86374,-1.25565,2.46714,4.2038,-1.03136,2.38266,4.61585,-4.25308,2.7723,3.3153,-4.53,2.91,3.33968,.46393,.95536,6.63358,4.25308,2.57765,3.2797,.41611,-1.46645,6.44766,7.08796,5.4348,.09962,2.62864,2.0359,3.84812,3.19836,1.98582,3.79695,3.77515,2.0394,3.64619,4.46582,2.42295,3.15517,2.16429,2.18987,3.85182,3.20823,3.22393,4.11582,2.6738,3.20534,4.0922,3.74519,3.16529,3.97241,4.16102,3.05907,3.71955,5.06201,1.93442,2.77609,2.26666,-7.42577,4.38981,4.44586,2.66399,3.17342,7.21453,2.26301,.07315,5.79979,2.34955,2.20406,2.84494,-.72087,4.43313,.71145,-3.32935,5.87704,.60603,-3.92456,5.44492,1.43161,-3.50095,5.49619,1.91491,-3.80315,5.02893,1.13104,-3.97394,5.18965,1.56355,-4.08276,4.84226,2.65011,-5.00365,4.18848,.42705,-1.09413,7.36053,.4964,-.47566,7.44036,5.25331,3.88158,3.36316,1.7187,.97461,4.55836,1.60863,-.94252,5.81419,1.65127,-.61087,5.58132,4.7655,-.70155,3.53463,.47831,.29577,7.10101,3.73496,4.50823,4.55045,4.5886,4.30204,4.04848,6.27933,6.61543,1.42585,1.22094,4.14217,5.10603,2.19349,3.10032,4.00058,3.10264,-4.35298,4.09591,6.71968,-4.78864,-1.7454,1.19382,-1.30679,5.73775,.72977,-1.59371,5.83321,2.45621,-4.34262,4.28388,2.20482,-4.30451,4.1625,4.98589,4.80246,3.75198,1.59229,-1.25771,5.45695,2.64455,4.52465,4.92156,2.76029,5.10097,5.01599,3.52396,8.00598,3.72916,5.59976,5.71547,2.72426,3.06393,6.56614,4.52998,5.72097,4.25458,2.83085,6.37439,4.78559,1.59169,.67273,-3.68802,5.7378,1.26256,-3.78769,5.41778,1.73255,-3.95277,5.00058,1.04362,-1.46497,5.66246,2.32123,-4.32907,4.25816,2.05685,-4.47767,4.52088,2.15308,-4.27632,4.03809,.94687,-1.03525,6.51227,1.46913,-4.03635,4.60491,1.02434,-3.98985,4.92669,.53342,-3.99322,5.1382,.76972,-6.09539,4.98588,.69961,-5.29185,5.4483,.66969,-4.94977,5.50961,.63095,-4.6951,5.44937,.58322,-4.51798,5.33987,1.53717,-4.42321,4.74547,1.6156,-4.47594,4.81363,1.72905,-4.61868,4.85446,1.83862,-4.82875,4.82374,2.36825,-3.10624,4.8681,7.54224,-1.04928,-2.43132,1.82661,-4.39953,4.39902,1.92956,-4.41183,4.49705,.59744,-2.01369,5.86646,1.40563,-1.7142,5.24109,.66245,-1.81932,5.86376,2.34234,.57222,4.2943,3.32732,.10486,4.11386,1.72617,-.91916,5.27336,5.1332,7.4856,2.66044,4.53864,6.31991,3.68342,3.98656,5.10949,4.46631,2.16968,-5.44043,4.45587,1.39563,5.01196,5.31603,1.6195,6.59922,4.92111,1.8914,8.23638,4.275,4.19583,2.23521,3.3751,5.73334,1.41174,2.43173,1.85989,2.35576,3.84318,4.98861,3.07465,3.08386,1.30326,1.41645,4.83109,1.30576,-.67278,6.41596,6.46517,.93712,1.68987,5.25866,.94581,2.97431,4.43234,.7221,3.52261,3.30068,.86164,3.87278,2.43018,1.13149,4.03903,1.82073,1.46795,4.22412,.56322,2.30769,5.56679,6.33814,-.52928,1.88118,5.5877,3.20807,2.68784,.24262,-1.46286,7.07149,1.61125,.33933,4.89542,7.74309,2.365,-2.00517,1.39114,1.85105,4.449,1.78579,-.97828,4.85047,4.67096,2.66446,3.08407,1.33397,-.28376,6.09705,7.2709,-2.89092,-2.25245,1.85643,2.58525,3.7579,.92339,.07308,6.67194,5.00059,-6.13513,1.89252,5.08528,-7.17859,.71471,7.15929,-.81182,-.07204,5.84305,-5.24802,.92409,6.84726,3.66292,.72469,2.41294,-8.25885,4.11921,.17991,-1.68986,6.5733,2.10366,-.16395,4.56612,6.40757,2.23602,1.56084,3.67007,2.36015,3.63523,3.17719,2.29427,3.7757,2.19612,-4.59832,4.47979,6.23488,-1.94443,1.66354,1.29292,-9.29592,4.09406,3.21065,-8.53328,2.802,4.06893,-7.99311,1.92512,2.72403,2.3158,3.77715,2.28846,2.39889,3.6976,1.99831,2.49655,3.68915,6.13004,3.39926,2.03852,2.28846,2.8865,3.77503,2.72403,2.96181,3.87177,3.17719,2.96414,3.87697,3.67007,2.92771,3.72432,4.01839,2.85736,3.48298,7.55581,4.10681,-.99192,4.01839,2.4837,3.4409,1.77622,-2.68395,5.21312,1.22224,-1.18244,5.95247,.73149,-2.53668,5.81534,4.13527,-6.99664,2.67197,3.31181,-7.66081,3.38296,1.3137,-8.63999,4.70246,5.94052,-6.22363,-.63147,1.99831,2.74384,3.74403,.90145,1.23699,5.75426,2.30898,-8.9742,3.60907,6.95415,-2.43984,-.13116,1.09882,-4.45879,5.12073,1.18112,-4.58,5.18956,1.25582,-4.7879,5.23705,1.32509,-5.10651,5.20501,1.54639,-5.81939,4.75789,1.95375,-4.18389,4.43171,2.1178,-4.13709,4.5551,2.28534,-4.0512,4.58244,2.85016,-3.66572,4.48499,5.27854,-2.23894,2.86122,.94671,1.90763,5.19678,1.31417,3.10491,4.2314,1.78,2.86,3.88155,1.84511,-4.09888,4.24726,5.43619,-4.03048,2.10985,.76644,3.18213,4.86145,1.93862,-6.61441,4.52109,.51657,1.58357,6.14836,1.24681,.2303,5.68104,.99783,-6.93092,4.97958,3.28881,-5.38251,3.79575,2.31163,-1.56624,4.59009,2.68025,-6.11157,4.09615,3.83293,-1.53733,4.13773,2.96186,-2.27421,4.44094,4.3869,-2.68329,3.64389,1.2173,-7.83446,4.96929,1.54237,-.13684,5.20101,3.87838,-6.04176,3.31108,3.08404,-6.80984,3.8142,3.74732,-4.50354,3.72645,6.09413,-3.20599,1.47348,4.58899,-4.72873,2.98322,6.58323,-3.94127,.07027,3.49258,-3.19582,4.1302,1.25554,.80234,5.30755,1.12612,-.9336,6.53878,1.44311,-1.14277,5.90513,.92304,-.52904,7.00342,1.75539,3.52912,4.3277,2.63259,3.71383,4.36463,3.38806,3.72198,4.30903,4.07577,3.67541,4.07606,4.62291,3.47469,3.64632,5.17175,2.53575,2.67087,7.29733,.76317,-.04877,4.70683,1.651,3.10953,4.07171,1.47682,3.47694,3.26982,1.47066,3.73195,2.52757,1.61731,3.86544,1.97089,1.85851,3.96178,1.57954,2.09794,4.085,7.66418,.67313,-2.43587,1.39704,-1.34014,5.63038,.88484,.65874,6.23323,.7671,-.96803,7.07793,.46021,-1.33411,6.78745,.74862,-1.06799,6.7983,1.23641,-1.58557,5.48049,.38731,-1.40999,6.95771,.31993,-1.60793,6.50868,1.63963,2.5563,3.86374,1.25565,2.46714,4.2038,1.03136,2.38266,4.61585,4.25308,2.7723,3.3153,4.53,2.91,3.33968]),N=[[1,0,-1.1269,7.4756],[4,0,-.4632,7.5866],[5,0,.3657,7.2429],[6,0,2.4733,5.7886],[8,0,4.019,5.2848],[9,0,4.886,5.3853],[10,0,8.2618,4.4815],[33,-4.4459,2.664,3.1734],[50,-4.7655,-.7016,3.5346],[67,-3.524,8.006,3.7292],[93,-7.5422,-1.0493,-2.4313],[103,-5.1332,7.4856,2.6604],[109,-1.8914,8.2364,4.275],[127,-7.7431,2.365,-2.0052],[133,-1.8564,2.5852,3.7579],[151,0,6.5454,5.0273],[168,0,3.271,5.236],[195,0,1.0594,6.7746],[197,0,1.7284,6.3167],[234,-7.6642,.6731,-2.4359],[263,4.4459,2.664,3.1734],[280,4.7655,-.7016,3.5346],[297,3.524,8.006,3.7292],[323,7.5422,-1.0493,-2.4313],[332,5.1332,7.4856,2.6604],[338,1.8914,8.2364,4.275],[356,7.7431,2.365,-2.0052],[362,1.8564,2.5852,3.7579],[454,7.6642,.6731,-2.4359],[463,1.6396,2.5563,3.8637],[243,-1.6396,2.5563,3.8637]],v=[0,-.46317,7.58658],_=Float64Array.from(N.flatMap(([,t,n,e])=>[t,n,e])),A=N.map(([t])=>t),j=(t,n)=>{const e=n??{scale:1,quaternion:new C.Quaternion,translation:new C.Vector3,rms:0,worldUnitsPerCm:1,count:0};return b.solveSimilarity(_,t,e),e.worldUnitsPerCm=e.scale,e.count=A.length,e},H=F.LANDMARK_POSE_FIT_DEFAULT_SMOOTHING,U={x:0,y:.5},W={x:1,y:.5},r=new C.Vector3,D=new C.Vector3,E=(t,{faceIndex:n,offset:e,smoothing:a=H,enabled:x=!0,onFit:P,onTrackingChange:g}={})=>{const s=w.useTrackerContext(),O=n??((s==null?void 0:s.type)==="face"?s.faceIndex:void 0)??0,c=G.useXRModelNode(l.XRModel.FACE_TRACKER),{camera:i}=q.useThree(),p=I.useCallback(d=>{var f,m;const u=(m=(f=c==null?void 0:c.detectionResults)==null?void 0:f.faceLandmarks)==null?void 0:m[O];if(!u||u.length<468)return!1;l.feedToWorld(U,i,r,0),l.feedToWorld(W,i,D,0);const y=r.distanceTo(D);for(let o=0;o<A.length;o+=1){const L=u[A[o]],R=-(L.z??0)*y;l.feedToWorld(L,i,r,R),d[o*3]=r.x,d[o*3+1]=r.y,d[o*3+2]=R}return!0},[i,O,c]);F.useLandmarkPoseFit(t,{canonical:_,readLive:p,offset:e,smoothing:a,enabled:x,onFit:P,onTrackingChange:g})},S=I.createContext(!1),K=({children:t,...n})=>{const e=I.useRef(null);return E(e,n),T.jsx(S.Provider,{value:!0,children:T.jsx("group",{ref:e,children:t})})};exports.CANONICAL_FACE_POSITIONS=k;exports.CANONICAL_HEAD_ANCHOR=v;exports.CANONICAL_HEAD_FIT_DEFAULT_SMOOTHING=H;exports.CANONICAL_RIGID_INDICES=A;exports.CANONICAL_RIGID_LANDMARKS=N;exports.CANONICAL_RIGID_POINTS=_;exports.CanonicalHeadFrame=K;exports.CanonicalHeadFrameContext=S;exports.solveCanonicalHeadPose=j;exports.useCanonicalHeadFit=E;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useEffect as w } from "react";
|
|
3
|
+
import { createPortal as R } from "react-dom";
|
|
4
|
+
import { f as i } from "./internal-BoFDq5hC.js";
|
|
5
|
+
const v = {
|
|
6
|
+
position: "fixed",
|
|
7
|
+
top: "10px",
|
|
8
|
+
left: "10px",
|
|
9
|
+
zIndex: 9999,
|
|
10
|
+
fontFamily: "'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace",
|
|
11
|
+
fontSize: "12px",
|
|
12
|
+
color: "#fff",
|
|
13
|
+
pointerEvents: "auto",
|
|
14
|
+
userSelect: "none"
|
|
15
|
+
}, S = {
|
|
16
|
+
background: "rgba(0, 0, 0, 0.85)",
|
|
17
|
+
borderRadius: "6px",
|
|
18
|
+
padding: "12px 16px",
|
|
19
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.5)",
|
|
20
|
+
backdropFilter: "blur(10px)",
|
|
21
|
+
border: "1px solid rgba(255, 255, 255, 0.1)",
|
|
22
|
+
minWidth: "240px"
|
|
23
|
+
}, B = {
|
|
24
|
+
...S,
|
|
25
|
+
padding: "8px 12px",
|
|
26
|
+
minWidth: "auto"
|
|
27
|
+
}, E = {
|
|
28
|
+
display: "flex",
|
|
29
|
+
justifyContent: "space-between",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
marginBottom: "12px",
|
|
32
|
+
paddingBottom: "8px",
|
|
33
|
+
borderBottom: "1px solid rgba(255, 255, 255, 0.2)"
|
|
34
|
+
}, I = {
|
|
35
|
+
fontSize: "13px",
|
|
36
|
+
fontWeight: "bold",
|
|
37
|
+
color: "#00ff9f",
|
|
38
|
+
letterSpacing: "0.5px",
|
|
39
|
+
textTransform: "uppercase"
|
|
40
|
+
}, D = {
|
|
41
|
+
display: "flex",
|
|
42
|
+
gap: "6px"
|
|
43
|
+
}, m = {
|
|
44
|
+
background: "rgba(255, 255, 255, 0.1)",
|
|
45
|
+
border: "1px solid rgba(255, 255, 255, 0.2)",
|
|
46
|
+
borderRadius: "4px",
|
|
47
|
+
color: "#fff",
|
|
48
|
+
padding: "4px 8px",
|
|
49
|
+
fontSize: "11px",
|
|
50
|
+
cursor: "pointer",
|
|
51
|
+
transition: "all 0.2s"
|
|
52
|
+
}, V = {
|
|
53
|
+
display: "grid",
|
|
54
|
+
gridTemplateColumns: "1fr 1fr",
|
|
55
|
+
gap: "10px"
|
|
56
|
+
}, d = {
|
|
57
|
+
display: "flex",
|
|
58
|
+
flexDirection: "column",
|
|
59
|
+
gap: "4px"
|
|
60
|
+
}, l = {
|
|
61
|
+
fontSize: "10px",
|
|
62
|
+
color: "rgba(255, 255, 255, 0.6)",
|
|
63
|
+
textTransform: "uppercase",
|
|
64
|
+
letterSpacing: "0.5px"
|
|
65
|
+
}, s = {
|
|
66
|
+
fontSize: "16px",
|
|
67
|
+
fontWeight: "bold",
|
|
68
|
+
color: "#fff"
|
|
69
|
+
}, y = {
|
|
70
|
+
...s,
|
|
71
|
+
color: "#00ff9f"
|
|
72
|
+
}, x = {
|
|
73
|
+
...s,
|
|
74
|
+
color: "#ffaa00"
|
|
75
|
+
}, b = {
|
|
76
|
+
...s,
|
|
77
|
+
color: "#ff4444"
|
|
78
|
+
}, a = {
|
|
79
|
+
fontSize: "11px",
|
|
80
|
+
color: "rgba(255, 255, 255, 0.5)",
|
|
81
|
+
marginLeft: "4px"
|
|
82
|
+
}, W = {
|
|
83
|
+
width: "100%",
|
|
84
|
+
height: "4px",
|
|
85
|
+
background: "rgba(255, 255, 255, 0.2)",
|
|
86
|
+
borderRadius: "2px",
|
|
87
|
+
overflow: "hidden",
|
|
88
|
+
marginTop: "4px"
|
|
89
|
+
}, j = (t) => ({
|
|
90
|
+
width: `${t}%`,
|
|
91
|
+
height: "100%",
|
|
92
|
+
background: t > 90 ? "#ff4444" : t > 70 ? "#ffaa00" : "#00ff9f",
|
|
93
|
+
transition: "width 0.3s ease, background 0.3s ease"
|
|
94
|
+
}), A = {
|
|
95
|
+
fontSize: "9px",
|
|
96
|
+
color: "rgba(255, 255, 255, 0.4)",
|
|
97
|
+
marginTop: "8px",
|
|
98
|
+
textAlign: "center",
|
|
99
|
+
fontStyle: "italic"
|
|
100
|
+
};
|
|
101
|
+
function p(t, o) {
|
|
102
|
+
return o === "fps" ? t >= 30 ? y : t >= 20 ? x : b : t <= 40 ? y : t <= 60 ? x : b;
|
|
103
|
+
}
|
|
104
|
+
const L = {
|
|
105
|
+
...v,
|
|
106
|
+
position: "static",
|
|
107
|
+
top: "auto",
|
|
108
|
+
left: "auto",
|
|
109
|
+
zIndex: "auto"
|
|
110
|
+
};
|
|
111
|
+
function $({
|
|
112
|
+
metrics: t,
|
|
113
|
+
collapsed: o,
|
|
114
|
+
onCollapse: T,
|
|
115
|
+
onClose: C,
|
|
116
|
+
position: f = "top-left",
|
|
117
|
+
keyboardShortcut: P = "ctrl+shift+d",
|
|
118
|
+
docked: c = !1
|
|
119
|
+
}) {
|
|
120
|
+
const [g, M] = k(null);
|
|
121
|
+
if (w(() => {
|
|
122
|
+
if (c) return;
|
|
123
|
+
const r = document.createElement("div");
|
|
124
|
+
return r.id = "xr-debugger-overlay", document.body.appendChild(r), M(r), () => {
|
|
125
|
+
document.body.removeChild(r);
|
|
126
|
+
};
|
|
127
|
+
}, [c]), !c && !g) return null;
|
|
128
|
+
const z = {
|
|
129
|
+
...v,
|
|
130
|
+
...f === "top-right" && { left: "auto", right: "10px" },
|
|
131
|
+
...f === "bottom-left" && { top: "auto", bottom: "10px" },
|
|
132
|
+
...f === "bottom-right" && {
|
|
133
|
+
top: "auto",
|
|
134
|
+
bottom: "10px",
|
|
135
|
+
left: "auto",
|
|
136
|
+
right: "10px"
|
|
137
|
+
}
|
|
138
|
+
}, h = /* @__PURE__ */ e("div", { style: c ? L : z, children: /* @__PURE__ */ n("div", { style: o ? B : S, children: [
|
|
139
|
+
/* @__PURE__ */ n("div", { style: E, children: [
|
|
140
|
+
/* @__PURE__ */ e("div", { style: I, children: o ? "AR Debugger" : "AR Performance" }),
|
|
141
|
+
/* @__PURE__ */ n("div", { style: D, children: [
|
|
142
|
+
/* @__PURE__ */ e(
|
|
143
|
+
"button",
|
|
144
|
+
{
|
|
145
|
+
style: m,
|
|
146
|
+
onClick: () => T(!o),
|
|
147
|
+
onMouseEnter: (r) => {
|
|
148
|
+
r.currentTarget.style.background = "rgba(255, 255, 255, 0.2)";
|
|
149
|
+
},
|
|
150
|
+
onMouseLeave: (r) => {
|
|
151
|
+
r.currentTarget.style.background = "rgba(255, 255, 255, 0.1)";
|
|
152
|
+
},
|
|
153
|
+
children: o ? "+" : "−"
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ e(
|
|
157
|
+
"button",
|
|
158
|
+
{
|
|
159
|
+
style: m,
|
|
160
|
+
onClick: C,
|
|
161
|
+
onMouseEnter: (r) => {
|
|
162
|
+
r.currentTarget.style.background = "rgba(255, 255, 255, 0.2)";
|
|
163
|
+
},
|
|
164
|
+
onMouseLeave: (r) => {
|
|
165
|
+
r.currentTarget.style.background = "rgba(255, 255, 255, 0.1)";
|
|
166
|
+
},
|
|
167
|
+
children: "✕"
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] })
|
|
171
|
+
] }),
|
|
172
|
+
!o && /* @__PURE__ */ n(u, { children: [
|
|
173
|
+
/* @__PURE__ */ n("div", { style: V, children: [
|
|
174
|
+
/* @__PURE__ */ n("div", { style: d, children: [
|
|
175
|
+
/* @__PURE__ */ e("div", { style: l, children: "Camera FPS" }),
|
|
176
|
+
/* @__PURE__ */ n("div", { children: [
|
|
177
|
+
/* @__PURE__ */ e("span", { style: p(t.cameraFPS, "fps"), children: i(t.cameraFPS, 0) }),
|
|
178
|
+
/* @__PURE__ */ e("span", { style: a, children: "fps" })
|
|
179
|
+
] })
|
|
180
|
+
] }),
|
|
181
|
+
/* @__PURE__ */ n("div", { style: d, children: [
|
|
182
|
+
/* @__PURE__ */ e("div", { style: l, children: "Resolution" }),
|
|
183
|
+
/* @__PURE__ */ e("span", { style: s, children: t.resolution })
|
|
184
|
+
] }),
|
|
185
|
+
/* @__PURE__ */ n("div", { style: d, children: [
|
|
186
|
+
/* @__PURE__ */ e("div", { style: l, children: "Detection" }),
|
|
187
|
+
/* @__PURE__ */ n("div", { children: [
|
|
188
|
+
/* @__PURE__ */ e("span", { style: p(t.detectionTime, "time"), children: i(t.detectionTime, 1) }),
|
|
189
|
+
/* @__PURE__ */ e("span", { style: a, children: "ms" })
|
|
190
|
+
] })
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ n("div", { style: d, children: [
|
|
193
|
+
/* @__PURE__ */ e("div", { style: l, children: "Rendering" }),
|
|
194
|
+
/* @__PURE__ */ n("div", { children: [
|
|
195
|
+
/* @__PURE__ */ e("span", { style: p(t.renderTime, "time"), children: i(t.renderTime, 1) }),
|
|
196
|
+
/* @__PURE__ */ e("span", { style: a, children: "ms" })
|
|
197
|
+
] })
|
|
198
|
+
] }),
|
|
199
|
+
/* @__PURE__ */ n("div", { style: d, children: [
|
|
200
|
+
/* @__PURE__ */ e("div", { style: l, children: "Effective FPS" }),
|
|
201
|
+
/* @__PURE__ */ n("div", { children: [
|
|
202
|
+
/* @__PURE__ */ e("span", { style: p(t.effectiveFPS, "fps"), children: i(t.effectiveFPS, 0) }),
|
|
203
|
+
/* @__PURE__ */ e("span", { style: a, children: "fps" })
|
|
204
|
+
] })
|
|
205
|
+
] }),
|
|
206
|
+
/* @__PURE__ */ n("div", { style: d, children: [
|
|
207
|
+
/* @__PURE__ */ e("div", { style: l, children: "Memory" }),
|
|
208
|
+
t.memory ? /* @__PURE__ */ n(u, { children: [
|
|
209
|
+
/* @__PURE__ */ n("div", { children: [
|
|
210
|
+
/* @__PURE__ */ e("span", { style: s, children: i(t.memory.used, 0) }),
|
|
211
|
+
/* @__PURE__ */ n("span", { style: a, children: [
|
|
212
|
+
"/ ",
|
|
213
|
+
i(t.memory.total, 0),
|
|
214
|
+
" MB"
|
|
215
|
+
] })
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ e("div", { style: W, children: /* @__PURE__ */ e("div", { style: j(t.memory.percentage) }) })
|
|
218
|
+
] }) : /* @__PURE__ */ e("span", { style: s, children: "N/A" })
|
|
219
|
+
] })
|
|
220
|
+
] }),
|
|
221
|
+
t.modelPerformance.length > 0 && /* @__PURE__ */ e(u, { children: /* @__PURE__ */ n(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
style: {
|
|
225
|
+
borderTop: "1px solid rgba(255, 255, 255, 0.15)",
|
|
226
|
+
marginTop: "12px",
|
|
227
|
+
paddingTop: "12px"
|
|
228
|
+
},
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ e("div", { style: l, children: "Model Performance" }),
|
|
231
|
+
/* @__PURE__ */ e(
|
|
232
|
+
"div",
|
|
233
|
+
{
|
|
234
|
+
style: {
|
|
235
|
+
marginTop: "8px",
|
|
236
|
+
display: "flex",
|
|
237
|
+
flexDirection: "column",
|
|
238
|
+
gap: "6px"
|
|
239
|
+
},
|
|
240
|
+
children: t.modelPerformance.map((r, F) => /* @__PURE__ */ n(
|
|
241
|
+
"div",
|
|
242
|
+
{
|
|
243
|
+
style: {
|
|
244
|
+
display: "flex",
|
|
245
|
+
justifyContent: "space-between",
|
|
246
|
+
alignItems: "center",
|
|
247
|
+
fontSize: "11px"
|
|
248
|
+
},
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ e("span", { style: { color: "rgba(255, 255, 255, 0.7)" }, children: r.name }),
|
|
251
|
+
/* @__PURE__ */ n("div", { children: [
|
|
252
|
+
/* @__PURE__ */ e("span", { style: p(r.processingTime, "time"), children: i(r.processingTime, 1) }),
|
|
253
|
+
/* @__PURE__ */ e("span", { style: a, children: "ms" })
|
|
254
|
+
] })
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
F
|
|
258
|
+
))
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
) }),
|
|
264
|
+
/* @__PURE__ */ n("div", { style: A, children: [
|
|
265
|
+
"Press ",
|
|
266
|
+
P.toUpperCase(),
|
|
267
|
+
" to toggle"
|
|
268
|
+
] })
|
|
269
|
+
] })
|
|
270
|
+
] }) });
|
|
271
|
+
return c ? h : R(h, g);
|
|
272
|
+
}
|
|
273
|
+
export {
|
|
274
|
+
$ as DebuggerUI
|
|
275
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),M=require("react-dom"),s=require("./internal-DS8Pdlsm.cjs"),b={position:"fixed",top:"10px",left:"10px",zIndex:9999,fontFamily:"'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace",fontSize:"12px",color:"#fff",pointerEvents:"auto",userSelect:"none"},j={background:"rgba(0, 0, 0, 0.85)",borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",border:"1px solid rgba(255, 255, 255, 0.1)",minWidth:"240px"},z={...j,padding:"8px 12px",minWidth:"auto"},k={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px",paddingBottom:"8px",borderBottom:"1px solid rgba(255, 255, 255, 0.2)"},R={fontSize:"13px",fontWeight:"bold",color:"#00ff9f",letterSpacing:"0.5px",textTransform:"uppercase"},N={display:"flex",gap:"6px"},g={background:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"4px",color:"#fff",padding:"4px 8px",fontSize:"11px",cursor:"pointer",transition:"all 0.2s"},w={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},i={display:"flex",flexDirection:"column",gap:"4px"},o={fontSize:"10px",color:"rgba(255, 255, 255, 0.6)",textTransform:"uppercase",letterSpacing:"0.5px"},a={fontSize:"16px",fontWeight:"bold",color:"#fff"},m={...a,color:"#00ff9f"},h={...a,color:"#ffaa00"},y={...a,color:"#ff4444"},l={fontSize:"11px",color:"rgba(255, 255, 255, 0.5)",marginLeft:"4px"},D={width:"100%",height:"4px",background:"rgba(255, 255, 255, 0.2)",borderRadius:"2px",overflow:"hidden",marginTop:"4px"},I=t=>({width:`${t}%`,height:"100%",background:t>90?"#ff4444":t>70?"#ffaa00":"#00ff9f",transition:"width 0.3s ease, background 0.3s ease"}),B={fontSize:"9px",color:"rgba(255, 255, 255, 0.4)",marginTop:"8px",textAlign:"center",fontStyle:"italic"};function c(t,n){return n==="fps"?t>=30?m:t>=20?h:y:t<=40?m:t<=60?h:y}const E={...b,position:"static",top:"auto",left:"auto",zIndex:"auto"};function U({metrics:t,collapsed:n,onCollapse:v,onClose:S,position:p="top-left",keyboardShortcut:T="ctrl+shift+d",docked:d=!1}){const[x,C]=u.useState(null);if(u.useEffect(()=>{if(d)return;const r=document.createElement("div");return r.id="xr-debugger-overlay",document.body.appendChild(r),C(r),()=>{document.body.removeChild(r)}},[d]),!d&&!x)return null;const P={...b,...p==="top-right"&&{left:"auto",right:"10px"},...p==="bottom-left"&&{top:"auto",bottom:"10px"},...p==="bottom-right"&&{top:"auto",bottom:"10px",left:"auto",right:"10px"}},f=e.jsx("div",{style:d?E:P,children:e.jsxs("div",{style:n?z:j,children:[e.jsxs("div",{style:k,children:[e.jsx("div",{style:R,children:n?"AR Debugger":"AR Performance"}),e.jsxs("div",{style:N,children:[e.jsx("button",{style:g,onClick:()=>v(!n),onMouseEnter:r=>{r.currentTarget.style.background="rgba(255, 255, 255, 0.2)"},onMouseLeave:r=>{r.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},children:n?"+":"−"}),e.jsx("button",{style:g,onClick:S,onMouseEnter:r=>{r.currentTarget.style.background="rgba(255, 255, 255, 0.2)"},onMouseLeave:r=>{r.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},children:"✕"})]})]}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:w,children:[e.jsxs("div",{style:i,children:[e.jsx("div",{style:o,children:"Camera FPS"}),e.jsxs("div",{children:[e.jsx("span",{style:c(t.cameraFPS,"fps"),children:s.formatNumber(t.cameraFPS,0)}),e.jsx("span",{style:l,children:"fps"})]})]}),e.jsxs("div",{style:i,children:[e.jsx("div",{style:o,children:"Resolution"}),e.jsx("span",{style:a,children:t.resolution})]}),e.jsxs("div",{style:i,children:[e.jsx("div",{style:o,children:"Detection"}),e.jsxs("div",{children:[e.jsx("span",{style:c(t.detectionTime,"time"),children:s.formatNumber(t.detectionTime,1)}),e.jsx("span",{style:l,children:"ms"})]})]}),e.jsxs("div",{style:i,children:[e.jsx("div",{style:o,children:"Rendering"}),e.jsxs("div",{children:[e.jsx("span",{style:c(t.renderTime,"time"),children:s.formatNumber(t.renderTime,1)}),e.jsx("span",{style:l,children:"ms"})]})]}),e.jsxs("div",{style:i,children:[e.jsx("div",{style:o,children:"Effective FPS"}),e.jsxs("div",{children:[e.jsx("span",{style:c(t.effectiveFPS,"fps"),children:s.formatNumber(t.effectiveFPS,0)}),e.jsx("span",{style:l,children:"fps"})]})]}),e.jsxs("div",{style:i,children:[e.jsx("div",{style:o,children:"Memory"}),t.memory?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("span",{style:a,children:s.formatNumber(t.memory.used,0)}),e.jsxs("span",{style:l,children:["/ ",s.formatNumber(t.memory.total,0)," MB"]})]}),e.jsx("div",{style:D,children:e.jsx("div",{style:I(t.memory.percentage)})})]}):e.jsx("span",{style:a,children:"N/A"})]})]}),t.modelPerformance.length>0&&e.jsx(e.Fragment,{children:e.jsxs("div",{style:{borderTop:"1px solid rgba(255, 255, 255, 0.15)",marginTop:"12px",paddingTop:"12px"},children:[e.jsx("div",{style:o,children:"Model Performance"}),e.jsx("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"6px"},children:t.modelPerformance.map((r,F)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"11px"},children:[e.jsx("span",{style:{color:"rgba(255, 255, 255, 0.7)"},children:r.name}),e.jsxs("div",{children:[e.jsx("span",{style:c(r.processingTime,"time"),children:s.formatNumber(r.processingTime,1)}),e.jsx("span",{style:l,children:"ms"})]})]},F))})]})}),e.jsxs("div",{style:B,children:["Press ",T.toUpperCase()," to toggle"]})]})]})});return d?f:M.createPortal(f,x)}exports.DebuggerUI=U;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";const i=require("./renderPasses-Bt8k0dkm.cjs"),xe=require("three"),M=require("react/jsx-runtime"),_=require("react"),Ce=require("./index-J3Qy6hi3.cjs"),Le=require("./landmarks-BP6RbRHN.cjs"),Y=require("./renderState-apSfg4eR.cjs"),oe=require("@react-three/fiber"),we=require("./selectors-Bq6tSgOY.cjs"),Ie=require("./FaceSurface-CHAMEeG1.cjs"),re=require("./landmarkMask-CvN-L5NT.cjs");function Pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const f=Pe(xe),Oe=[{label:"Wireframe",value:i.FACE_MESH_MATERIAL_TYPES.wireframe},{label:"Basic",value:i.FACE_MESH_MATERIAL_TYPES.basic},{label:"Standard",value:i.FACE_MESH_MATERIAL_TYPES.standard},{label:"Physical",value:i.FACE_MESH_MATERIAL_TYPES.physical},{label:"Toon",value:i.FACE_MESH_MATERIAL_TYPES.toon},{label:"Normal",value:i.FACE_MESH_MATERIAL_TYPES.normal},{label:"Matcap",value:i.FACE_MESH_MATERIAL_TYPES.matcap},{label:"Shader",value:i.FACE_MESH_MATERIAL_TYPES.shader}],De=[{label:"Original Face",value:i.FACE_MESH_SHADER_PRESETS.originalFace},{label:"Composite",value:i.FACE_MESH_SHADER_PRESETS.composite}],Ue=[{label:"Front",value:i.FACE_MESH_SIDES.front},{label:"Back",value:i.FACE_MESH_SIDES.back},{label:"Double",value:i.FACE_MESH_SIDES.double}],Ne=[{label:"None",value:i.FACE_MESH_TEXTURE_MAPS.none},{label:"UV Map 1",value:i.FACE_MESH_TEXTURE_MAPS.canonical},{label:"UV Map 2",value:i.FACE_MESH_TEXTURE_MAPS.style2}],He=[{label:"None",value:i.FACE_MESH_ALPHA_MAPS.none},{label:"Default Mask",value:i.FACE_MESH_ALPHA_MAPS.canonical}],Be=[{label:"Solid",value:i.FACE_MESH_MASK_TEXTURE_SOURCES.solid},{label:"Gradient",value:i.FACE_MESH_MASK_TEXTURE_SOURCES.gradient},{label:"Image URL",value:i.FACE_MESH_MASK_TEXTURE_SOURCES.imageUrl},{label:"Media URL",value:i.FACE_MESH_MASK_TEXTURE_SOURCES.mediaUrl}],Xe=[{label:"Normal",value:i.FACE_MESH_BLEND_MODES.normal},{label:"Add",value:i.FACE_MESH_BLEND_MODES.add},{label:"Subtract",value:i.FACE_MESH_BLEND_MODES.subtract},{label:"Multiply",value:i.FACE_MESH_BLEND_MODES.multiply},{label:"Screen",value:i.FACE_MESH_BLEND_MODES.screen},{label:"Overlay",value:i.FACE_MESH_BLEND_MODES.overlay},{label:"Soft Light",value:i.FACE_MESH_BLEND_MODES.softLight},{label:"Hard Light",value:i.FACE_MESH_BLEND_MODES.hardLight},{label:"Lighten",value:i.FACE_MESH_BLEND_MODES.lighten},{label:"Darken",value:i.FACE_MESH_BLEND_MODES.darken},{label:"Difference",value:i.FACE_MESH_BLEND_MODES.difference},{label:"Exclusion",value:i.FACE_MESH_BLEND_MODES.exclusion}],ie=["both","left","right"],le=["shader","image"],ce={eye:"both",mode:"shader",color:"#4fa3ff",textureUrl:"",tintImage:!1,scale:1,opacity:.85,targetFps:0,smoothing:0,leadMs:80,mirrored:!1,faceIndex:0,holdMs:250},Ke=[{key:"eye",label:"Eye",type:"select",options:ie.map(e=>({label:e,value:e}))},{key:"mode",label:"Material",type:"select",options:le.map(e=>({label:e,value:e}))},{key:"color",label:"Color / tint",type:"color"},{key:"textureUrl",label:"Image URL (image mode)",type:"text"},{key:"tintImage",label:"Tint image with color",type:"boolean"},{key:"scale",label:"Scale (× iris radius)",type:"number",min:.2,max:4,step:.05},{key:"opacity",label:"Opacity",type:"number",min:0,max:1,step:.05},{key:"targetFps",label:"Face FPS (0 = session)",type:"number",min:0,max:60,step:1},{key:"smoothing",label:"Smoothing (0 = raw)",type:"number",min:0,max:60,step:1},{key:"leadMs",label:"Lead between samples (ms)",type:"number",min:0,max:200,step:10},{key:"mirrored",label:"Mirror material",type:"boolean"},{key:"faceIndex",label:"Face index",type:"number",min:0,max:3,step:1},{key:"holdMs",label:"Hold (ms)",type:"number",min:0,max:1e3,step:10}],Ge=e=>({...ce,...e}),Ye=(e,t)=>({...e,...t}),je=["lips","contour","blush","highlighter","eyeshadow","eyeliner","brows"],O=["matte","satin","gloss","shimmer","metallic","glitter"],ze=["both","left","right"],ue=["lips","blush","contour","highlighter","brows"],D={matte:{shine:0,sparkleDensity:0,sparkleSize:.25},satin:{shine:.3,sparkleDensity:0,sparkleSize:.25},gloss:{shine:.8,sparkleDensity:0,sparkleSize:.25},shimmer:{shine:.5,sparkleDensity:.6,sparkleSize:.25},metallic:{shine:.7,sparkleDensity:0,sparkleSize:.25},glitter:{shine:.7,sparkleDensity:.35,sparkleSize:.8}},me=["shine","sparkleDensity","sparkleSize"],P=[.1,1.5],T={lips:{nude:"#b9826f",rosewood:"#9e5a5a",mauve:"#a0606e",softPink:"#d88a95",coral:"#e0645a",peach:"#e8907a",classicRed:"#a3202d",brick:"#8e3b2c",berry:"#7b2846",plum:"#5e2a45",wine:"#5a1a28",chocolate:"#5b3a2e"},contour:{fair:"#c9a08a",light:"#b48a72",medium:"#98705a",tan:"#7f5a45",deep:"#5e4032",rich:"#432c22",bronzeLight:"#b9805a",bronzeDeep:"#8a5532"},blush:{softPink:"#e8a0a8",rose:"#d97a85",peach:"#f0a07c",coral:"#ec7b67",apricot:"#f2a86b",mauve:"#c0828f",berry:"#b04a68",brick:"#b4574a",terracotta:"#c4694c",plum:"#8f4a68"},highlighter:{pearl:"#f6eee6",champagne:"#f2dcc0",gold:"#e9c27a",roseGold:"#eab3a0",bronzeGlow:"#d29a66",lilacPearl:"#e6d6ef"},eyeshadow:{ivory:"#f3e6d3",champagne:"#e9d2b0",sand:"#d2b48c",taupe:"#8f7a6e",warmBrown:"#8b5a3c",coolBrown:"#6e5a50",espresso:"#3e2a22",charcoal:"#3a3a3c",black:"#141414",bronze:"#a8743f",copper:"#b5653a",gold:"#d4ae5a",roseGold:"#d49a8a",plum:"#6b3a5a",burgundy:"#6e2433",olive:"#6f6a3a",navy:"#23314f",emerald:"#1f6b52",teal:"#1f6f73",lilac:"#b8a0cf",silver:"#c5c7cb"},eyeliner:{black:"#0d0d0d",brownBlack:"#231a16",brown:"#4a3226",charcoal:"#33343a",navy:"#1c2848",plum:"#4f2442",emerald:"#145a44",bronze:"#8a5a2e",gold:"#c9a14e",white:"#f5f3ef"},brows:{blonde:"#a88a62",taupe:"#7c6a5c",softBrown:"#6b4f3c",mediumBrown:"#57402f",darkBrown:"#3d2c22",softBlack:"#252020",auburn:"#7a4030",grey:"#8a8580"}},v=e=>Object.keys(T[e]),pe={lips:v("lips"),contour:v("contour"),blush:v("blush"),highlighter:v("highlighter"),eyeshadow:v("eyeshadow"),eyeliner:v("eyeliner"),brows:v("brows")},U=e=>ue.includes(e),z=(e,t)=>typeof t=="string"&&Object.prototype.hasOwnProperty.call(T[e],t),se=(e,t)=>t==="custom"||t==="auto"&&U(e)||z(e,t);function de(e,t){return t==="auto"?U(e)?"auto":void 0:z(e,t)?T[e][t]:void 0}const w=e=>{const t=e.trim().toLowerCase(),o=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(t);return o?`#${o[1]}${o[1]}${o[2]}${o[2]}${o[3]}${o[3]}`:t},We=(e,t)=>Object.values(T[e]).some(o=>w(o)===t),he=(e,t,o,r,n)=>{const a=se(e,t),s=a?t:se(e,r)?r:"custom",l=typeof o=="string"&&o.trim()?o.trim():void 0;if(s==="custom")return{shade:s,color:l??n};const u=s==="auto"?n:de(e,s)??n;if(l!==void 0){const c=w(l),g=a&&(We(e,c)||c===w(n));if(c!==w(u)&&!g)return{shade:"custom",color:l}}return{shade:s,color:u}},W=e=>{const t=e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase();return t[0].toUpperCase()+t.slice(1)},Se=e=>[{label:"Custom color",value:"custom"},...U(e)?[{label:"Auto (own color)",value:"auto"}]:[],...pe[e].map(t=>({label:W(t),value:t}))],V=["lipstick","gloss","matte","tint","metallic","gradient","shimmer","glitter"],ge=["texture","solid"],Ee=["outward","vertical","horizontal"],fe={enabled:!0,preset:"custom",shade:"custom",maskMode:"outer-and-inner-lips",colorMode:"texture",color:"#e85d75",opacity:.8,coverage:.8,finish:"satin",...D.satin,sparkleColor:"",intensity:1,shading:1,gloss:.35,roughness:.5,highlightColor:"#ffffff",gradientColor:"#ffd6de",gradientAmount:0,gradientDirection:"outward",edgeSoftness:.12,innerLipColor:"#7a1f36",innerLipAmount:0,innerLipWidth:.35,splitLips:!1,lowerLipColor:"#e85d75",lowerLipOpacity:.8,textureScaleX:1,textureScaleY:1,textureOffsetX:0,textureOffsetY:0,textureRotation:0,textureFlipX:!1,textureFlipY:!1},q={lipstick:{finish:"satin",coverage:.85,color:"#c0304f",opacity:.85,intensity:1,shading:1,gloss:.35,roughness:.5,highlightColor:"#ffffff",gradientAmount:0},gloss:{finish:"gloss",coverage:.45,color:"#e05a7a",opacity:.7,intensity:1,shading:1,gloss:.95,roughness:.12,highlightColor:"#ffffff",gradientAmount:0},matte:{finish:"matte",coverage:.95,color:"#a8323e",opacity:.92,intensity:1,shading:1,gloss:0,roughness:1,highlightColor:"#ffffff",gradientAmount:0},tint:{finish:"matte",coverage:.3,color:"#ff6b81",opacity:.4,intensity:1,shading:1,gloss:.1,roughness:.7,highlightColor:"#ffffff",gradientAmount:0},metallic:{finish:"metallic",coverage:.9,color:"#b5485a",opacity:.9,intensity:1,shading:1,gloss:1,roughness:.3,highlightColor:"#f3c46b",gradientAmount:0},gradient:{finish:"satin",coverage:.8,color:"#d6336c",opacity:.8,intensity:1,shading:1,gloss:.3,roughness:.5,highlightColor:"#ffffff",gradientColor:"#f9c2cf",gradientAmount:.85,gradientDirection:"outward"},shimmer:{finish:"shimmer",coverage:.7,color:"#c8577a",opacity:.8,intensity:1,shading:1,gloss:.4,roughness:.45,highlightColor:"#ffffff",gradientAmount:0},glitter:{finish:"glitter",coverage:.5,color:"#b8406a",opacity:.8,intensity:1,shading:1,gloss:.5,roughness:.35,highlightColor:"#ffffff",gradientAmount:0}},$=e=>typeof e=="string"&&V.includes(e),p=(e,t,o,r)=>typeof e=="number"&&Number.isFinite(e)?Math.min(o,Math.max(t,e)):r,Ve=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,x=(e,t)=>typeof e=="string"&&e.trim()?e:t,qe=(e,t)=>typeof e=="string"?e.trim():t,C=(e,t)=>typeof e=="boolean"?e:t,K=(e,t,o)=>typeof t=="string"&&e.includes(t)?t:o,$e=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),be=(e={})=>{const t=$(e.preset)?e.preset:"custom",o=$e(e),r={...fe,...t==="custom"?{}:q[t]},n=K(O,o.finish,r.finish),a={...r,...D[n]},s={...a,...o},{shade:l,color:u}=he("lips",o.shade,o.color,a.shade,a.color);return{enabled:C(s.enabled,a.enabled),preset:t,shade:l,maskMode:s.maskMode==="outer-lips"?"outer-lips":"outer-and-inner-lips",colorMode:K(ge,s.colorMode,a.colorMode),color:u,opacity:p(s.opacity,0,1,a.opacity),coverage:p(s.coverage,0,1,a.coverage),finish:n,shine:p(s.shine,0,1,a.shine),sparkleDensity:p(s.sparkleDensity,0,1,a.sparkleDensity),sparkleSize:p(s.sparkleSize,...P,a.sparkleSize),sparkleColor:qe(s.sparkleColor,a.sparkleColor),intensity:p(s.intensity,0,1,a.intensity),shading:p(s.shading,0,1,a.shading),gloss:p(s.gloss,0,1,a.gloss),roughness:p(s.roughness,0,1,a.roughness),highlightColor:x(s.highlightColor,a.highlightColor),gradientColor:x(s.gradientColor,a.gradientColor),gradientAmount:p(s.gradientAmount,0,1,a.gradientAmount),gradientDirection:K(Ee,s.gradientDirection,a.gradientDirection),edgeSoftness:p(s.edgeSoftness,0,1,a.edgeSoftness),innerLipColor:x(s.innerLipColor,a.innerLipColor),innerLipAmount:p(s.innerLipAmount,0,1,a.innerLipAmount),innerLipWidth:p(s.innerLipWidth,0,1,a.innerLipWidth),splitLips:C(s.splitLips,a.splitLips),lowerLipColor:x(s.lowerLipColor,a.lowerLipColor),lowerLipOpacity:p(s.lowerLipOpacity,0,1,a.lowerLipOpacity),textureScaleX:p(s.textureScaleX,.05,20,a.textureScaleX),textureScaleY:p(s.textureScaleY,.05,20,a.textureScaleY),textureOffsetX:p(s.textureOffsetX,-2,2,a.textureOffsetX),textureOffsetY:p(s.textureOffsetY,-2,2,a.textureOffsetY),textureRotation:Ve(s.textureRotation,a.textureRotation),textureFlipX:C(s.textureFlipX,a.textureFlipX),textureFlipY:C(s.textureFlipY,a.textureFlipY)}},Ze=(e,t)=>{const o=Object.keys(e).some(a=>t[a]===void 0),r=Object.fromEntries(Object.entries(t).filter(([a,s])=>s!==void 0&&(o||s!==e[a]))),n={...e};if(r.preset!==e.preset&&$(r.preset)&&Object.assign(n,q[r.preset]),Object.assign(n,r),n.finish!==e.finish&&O.includes(n.finish)){Object.assign(n,D[n.finish]);for(const a of me)r[a]!==void 0&&(n[a]=r[a])}return r.color===void 0?n.shade!=="custom"&&delete n.color:r.shade===void 0&&r.color!==e.color&&(n.shade="custom"),be(n)},d={min:0,max:1,step:.01},Je=[{key:"enabled",label:"On",type:"boolean"},{key:"preset",label:"Preset",type:"select",options:[{label:"Custom",value:"custom"},...V.map(e=>({label:e[0].toUpperCase()+e.slice(1),value:e}))]},{key:"shade",label:"Shade",type:"select",options:Se("lips")},{key:"maskMode",label:"Mask mode",type:"select",options:[{label:"Outer + inner lips (mouth cut out)",value:"outer-and-inner-lips"},{label:"Outer lips (mouth included)",value:"outer-lips"}]},{key:"colorMode",label:"Color mode",type:"select",options:[{label:"Design texture",value:"texture"},{label:"Procedural (solid / gradient)",value:"solid"}]},{key:"color",label:"Tint color",type:"color"},{key:"opacity",label:"Opacity",type:"number",...d},{key:"coverage",label:"Coverage (sheer → opaque)",type:"number",...d},{key:"finish",label:"Finish",type:"select",options:O.map(e=>({label:W(e),value:e}))},{key:"shine",label:"Shine",type:"number",...d},{key:"sparkleColor",label:"Sparkle color (blank = from shade)",type:"text"},{key:"sparkleDensity",label:"Sparkle density",type:"number",...d},{key:"sparkleSize",label:"Sparkle size (mm)",type:"number",min:P[0],max:P[1],step:.05},{key:"intensity",label:"Tint intensity",type:"number",...d},{key:"shading",label:"Follow light (0 = flat)",type:"number",...d},{key:"gloss",label:"Gloss",type:"number",...d},{key:"roughness",label:"Roughness",type:"number",...d},{key:"highlightColor",label:"Highlight color",type:"color"},{key:"gradientColor",label:"Gradient color",type:"color"},{key:"gradientAmount",label:"Gradient amount",type:"number",...d},{key:"gradientDirection",label:"Gradient direction",type:"select",options:[{label:"Mouth line → outer edge",value:"outward"},{label:"Bottom → top",value:"vertical"},{label:"Person's right → left corner",value:"horizontal"}]},{key:"edgeSoftness",label:"Edge softness",type:"number",...d},{key:"innerLipColor",label:"Inner lip color",type:"color"},{key:"innerLipAmount",label:"Inner lip amount",type:"number",...d},{key:"innerLipWidth",label:"Inner lip width",type:"number",...d},{key:"splitLips",label:"Separate lower lip",type:"boolean"},{key:"lowerLipColor",label:"Lower lip color",type:"color"},{key:"lowerLipOpacity",label:"Lower lip opacity",type:"number",...d},{key:"textureScaleX",label:"Texture scale X",type:"number",min:.1,max:10,step:.05},{key:"textureScaleY",label:"Texture scale Y",type:"number",min:.1,max:10,step:.05},{key:"textureOffsetX",label:"Texture offset X",type:"number",min:-1,max:1,step:.01},{key:"textureOffsetY",label:"Texture offset Y",type:"number",min:-1,max:1,step:.01},{key:"textureRotation",label:"Texture rotation°",type:"number",min:-180,max:180,step:1},{key:"textureFlipX",label:"Flip horizontal",type:"boolean"},{key:"textureFlipY",label:"Flip vertical",type:"boolean"}],Qe=(e,t,o=new f.Matrix3)=>{const r=(t.minU+t.maxU)/2,n=(t.minV+t.maxV)/2,a=t.maxU-t.minU,s=t.maxV-t.minV,l=-f.MathUtils.degToRad(e.textureRotation),u=Math.cos(l),c=Math.sin(l),g=(e.textureFlipX?-1:1)/Math.max(e.textureScaleX,.001),h=(e.textureFlipY?-1:1)/Math.max(e.textureScaleY,.001),S=g*u,b=-g*c,m=h*c,y=h*u,k=r+e.textureOffsetX*a,B=n+e.textureOffsetY*s,te=r-(S*k+b*B),X=n-(m*k+y*B);return o.set(S,b,te,m,y,X,0,0,1)},et=["eachOther","photo","canonicalTexture","faceTexture"],Z=["natural","keepColors","raw"],F={preset:"natural",matchSkinTone:1,matchLighting:1,edgeMatch:1,edgeSoftness:1.2,edgeInset:.3,ownEyes:!0,ownMouth:!0,featureSoftness:.25,detail:1,smoothing:.35,amount:1},N={natural:{matchSkinTone:1,matchLighting:1,edgeMatch:1,edgeSoftness:1.2,ownEyes:!0,ownMouth:!0,detail:1},keepColors:{matchSkinTone:0,matchLighting:.7,edgeMatch:1,edgeSoftness:1},raw:{matchSkinTone:0,matchLighting:0,edgeMatch:0,edgeSoftness:.4}},J=e=>typeof e=="string"&&Z.includes(e),ve=e=>_e(e)?"keepColors":"natural",_e=e=>{var t;return(e==null?void 0:e.kind)==="canonicalTexture"||(e==null?void 0:e.kind)==="faceTexture"&&((t=e.face)==null?void 0:t.kind)==="canonical"},ye=.1,ke=(e,t,o,r)=>typeof e=="number"&&Number.isFinite(e)?Math.min(o,Math.max(t,e)):r,ne=(e,t)=>typeof e=="boolean"?e:t,tt=(e,t,o)=>typeof t=="string"&&e.includes(t)?t:o,Q=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),R={matchSkinTone:[0,1],matchLighting:[0,1],edgeMatch:[0,1],edgeSoftness:[.3,3],edgeInset:[0,1.5],featureSoftness:[.1,.6],detail:[0,1],smoothing:[0,1],amount:[0,1]},Me=(e,t)=>Object.entries(N[t]).every(([o,r])=>e[o]===r),j=(e={},t={})=>{const o=e.preset??ve(t.source),r=J(o)?o:"custom",n={...F,..._e(t.source)?{featureSoftness:ye}:{},...r==="custom"?{}:N[r]},a={...n,...Q(e)},s=R,l=c=>ke(a[c],s[c][0],s[c][1],n[c]),u={preset:r,matchSkinTone:l("matchSkinTone"),matchLighting:l("matchLighting"),edgeMatch:l("edgeMatch"),edgeSoftness:l("edgeSoftness"),edgeInset:l("edgeInset"),ownEyes:ne(a.ownEyes,n.ownEyes),ownMouth:ne(a.ownMouth,n.ownMouth),featureSoftness:l("featureSoftness"),detail:l("detail"),smoothing:l("smoothing"),amount:l("amount")};return r!=="custom"&&!Me(u,r)&&(u.preset="custom"),u},at=(e,t)=>{const o=Object.fromEntries(Object.entries(t).filter(([n,a])=>n!=="preset"&&a!==void 0&&a!==e[n])),r=t.preset;return J(r)&&(r!==e.preset||!Me(e,r))?j({...e,...N[r],...o,preset:r}):j({...e,...o,preset:r==="custom"?"custom":e.preset})},E={min:0,max:1,step:.01},I=(e,t)=>({min:R[e][0],max:R[e][1],step:t}),ot={natural:"Natural",keepColors:"Keep colors",raw:"Raw"},rt=[{key:"preset",label:"Preset",type:"select",options:[{label:"Custom",value:"custom"},...Z.map(e=>({label:ot[e],value:e}))]},{key:"matchSkinTone",label:"Match skin tone",type:"number",...E},{key:"matchLighting",label:"Match lighting",type:"number",...E},{key:"edgeMatch",label:"Match at the edge",type:"number",...E},{key:"edgeSoftness",label:"Edge softness (cm)",type:"number",...I("edgeSoftness",.05)},{key:"edgeInset",label:"Edge inset (cm)",type:"number",...I("edgeInset",.05)},{key:"ownEyes",label:"Keep own eyes",type:"boolean"},{key:"ownMouth",label:"Keep own mouth",type:"boolean"},{key:"featureSoftness",label:"Eye and mouth rim (cm)",type:"number",...I("featureSoftness",.01)},{key:"detail",label:"Detail",type:"number",...E},{key:"smoothing",label:"Smoothing",type:"number",...E},{key:"amount",label:"Amount",type:"number",...E}],H=["leftLeft","rightRight","flip","upsideDown"],Ae={leftLeft:"your left half twice",rightRight:"your right half twice",flip:"left and right swapped",upsideDown:"eyes and mouth upside down"},st=e=>typeof e=="string"&&H.includes(e),Fe={variant:"leftLeft",matchLighting:1,edgeSoftness:1.2,smoothing:.35,amount:1},Re=(e={})=>{const t=Fe,o={...t,...Q(e)},r=R,n=a=>ke(o[a],r[a][0],r[a][1],t[a]);return{variant:tt(H,o.variant,t.variant),matchLighting:n("matchLighting"),edgeSoftness:n("edgeSoftness"),smoothing:n("smoothing"),amount:n("amount")}},nt=(e,t)=>Re({...e,...Q(t)}),it=[{key:"variant",label:"Variant",type:"select",options:H.map(e=>({label:Ae[e],value:e}))},{key:"matchLighting",label:"Match lighting",type:"number",...E},{key:"edgeSoftness",label:"Edge softness (cm)",type:"number",...I("edgeSoftness",.05)},{key:"smoothing",label:"Smoothing",type:"number",...E},{key:"amount",label:"Amount",type:"number",...E}],lt=e=>({matchSkinTone:0,matchLighting:e.matchLighting,edgeMatch:e.matchLighting,edgeSoftness:e.edgeSoftness,edgeInset:F.edgeInset,ownEyes:!1,ownMouth:!1,featureSoftness:F.featureSoftness,detail:F.detail,smoothing:e.smoothing,amount:e.amount}),ct=Object.freeze({...Ie.faceSurfaceBlending,transparent:!1,depthTest:!0,depthWrite:!1,toneMapped:!1}),ut=`
|
|
2
|
+
varying vec2 vUv;
|
|
3
|
+
|
|
4
|
+
void main() {
|
|
5
|
+
vUv = uv;
|
|
6
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7
|
+
}
|
|
8
|
+
`,mt=`
|
|
9
|
+
uniform sampler2D cameraTexture;
|
|
10
|
+
uniform sampler2D retouchMaskTexture;
|
|
11
|
+
uniform vec2 texelSize;
|
|
12
|
+
uniform float retouchAmount;
|
|
13
|
+
uniform float blurRadius;
|
|
14
|
+
uniform float detailPreservation;
|
|
15
|
+
uniform float blemishReduction;
|
|
16
|
+
uniform float blemishRadius;
|
|
17
|
+
uniform float previewMask;
|
|
18
|
+
uniform float protectLandmarks;
|
|
19
|
+
uniform float clipMinX;
|
|
20
|
+
uniform float clipMaxX;
|
|
21
|
+
varying vec2 vUv;
|
|
22
|
+
|
|
23
|
+
vec3 sampleCamera(vec2 uv) {
|
|
24
|
+
return texture2D(cameraTexture, clamp(uv, vec2(0.0), vec2(1.0))).rgb;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
vec3 readRetouchMask(vec2 uv) {
|
|
28
|
+
vec4 mask = texture2D(retouchMaskTexture, uv);
|
|
29
|
+
float faceRegion = clamp(mask.b, 0.0, 1.0);
|
|
30
|
+
float softFaceRegion = min(mask.r, faceRegion);
|
|
31
|
+
float protectedRegion = min(mask.g, faceRegion) * protectLandmarks;
|
|
32
|
+
float hardProtectedRegion = step(0.08, protectedRegion);
|
|
33
|
+
float softRetouchRegion = softFaceRegion * (1.0 - protectedRegion);
|
|
34
|
+
float hardRetouchRegion = step(0.5, faceRegion) * (1.0 - hardProtectedRegion);
|
|
35
|
+
|
|
36
|
+
return vec3(
|
|
37
|
+
clamp(softRetouchRegion, 0.0, 1.0),
|
|
38
|
+
clamp(protectedRegion, 0.0, 1.0),
|
|
39
|
+
clamp(hardRetouchRegion, 0.0, 1.0)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
float retouchCoverage(vec2 uv) {
|
|
44
|
+
return step(0.001, readRetouchMask(uv).x);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
void addMaskedBlurSample(inout vec3 color, inout float weightSum, vec2 centerUv, vec2 sampleUv, float weight) {
|
|
48
|
+
float coverage = retouchCoverage(sampleUv);
|
|
49
|
+
vec3 sampleColor = mix(sampleCamera(centerUv), sampleCamera(sampleUv), coverage);
|
|
50
|
+
color += sampleColor * weight;
|
|
51
|
+
weightSum += weight;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
vec3 maskedBlurCamera(vec2 uv, float radius) {
|
|
55
|
+
vec2 r = texelSize * radius;
|
|
56
|
+
vec3 color = sampleCamera(uv) * 0.2;
|
|
57
|
+
float weightSum = 0.2;
|
|
58
|
+
|
|
59
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, 0.0), 0.1);
|
|
60
|
+
addMaskedBlurSample(color, weightSum, uv, uv - vec2(r.x, 0.0), 0.1);
|
|
61
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(0.0, r.y), 0.1);
|
|
62
|
+
addMaskedBlurSample(color, weightSum, uv, uv - vec2(0.0, r.y), 0.1);
|
|
63
|
+
addMaskedBlurSample(color, weightSum, uv, uv + r, 0.075);
|
|
64
|
+
addMaskedBlurSample(color, weightSum, uv, uv - r, 0.075);
|
|
65
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, -r.y), 0.075);
|
|
66
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(-r.x, r.y), 0.075);
|
|
67
|
+
addMaskedBlurSample(color, weightSum, uv, uv + r * 2.0, 0.05);
|
|
68
|
+
addMaskedBlurSample(color, weightSum, uv, uv - r * 2.0, 0.05);
|
|
69
|
+
|
|
70
|
+
return color / max(weightSum, 0.001);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
float retouchLuminance(vec3 color) {
|
|
74
|
+
return dot(color, vec3(0.299, 0.587, 0.114));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
vec3 reduceBlemishes(vec3 current, vec3 source, vec3 localAverage, vec3 skinBase, float skinMask) {
|
|
78
|
+
float originalLum = retouchLuminance(source);
|
|
79
|
+
float localLum = retouchLuminance(localAverage);
|
|
80
|
+
float redness = max(source.r - max(source.g, source.b), 0.0);
|
|
81
|
+
float localRedness = max(localAverage.r - max(localAverage.g, localAverage.b), 0.0);
|
|
82
|
+
float excessRedness = max(redness - localRedness * 0.72, 0.0);
|
|
83
|
+
float darkSpot = max(localLum - originalLum, 0.0);
|
|
84
|
+
float contrast = length(source - localAverage);
|
|
85
|
+
float candidate =
|
|
86
|
+
smoothstep(0.012, 0.09, excessRedness) +
|
|
87
|
+
smoothstep(0.018, 0.13, darkSpot) +
|
|
88
|
+
smoothstep(0.03, 0.16, contrast);
|
|
89
|
+
float blemishMask = clamp(candidate * 0.72, 0.0, 1.0) * skinMask * blemishReduction;
|
|
90
|
+
|
|
91
|
+
vec3 chromaReduced = vec3(
|
|
92
|
+
mix(current.r, min(current.r, localAverage.r * 1.04), blemishMask),
|
|
93
|
+
mix(current.g, max(current.g, localAverage.g * 0.98), 0.35 * blemishMask),
|
|
94
|
+
mix(current.b, max(current.b, localAverage.b * 0.98), 0.35 * blemishMask)
|
|
95
|
+
);
|
|
96
|
+
vec3 texture = source - localAverage;
|
|
97
|
+
vec3 repaired = clamp(skinBase + texture * detailPreservation * 0.18, 0.0, 1.0);
|
|
98
|
+
|
|
99
|
+
return mix(chromaReduced, repaired, min(blemishMask * 1.15, 1.0));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void main() {
|
|
103
|
+
if (vUv.x < clipMinX || vUv.x > clipMaxX) discard;
|
|
104
|
+
|
|
105
|
+
vec3 original = sampleCamera(vUv);
|
|
106
|
+
vec3 masks = readRetouchMask(vUv);
|
|
107
|
+
float faceAlpha = max(max(masks.x, masks.y), masks.z);
|
|
108
|
+
|
|
109
|
+
if (previewMask > 0.5) {
|
|
110
|
+
float sharpPreview = 1.0 - step(0.001, retouchAmount + blurRadius);
|
|
111
|
+
float retouchPreview = mix(masks.x, masks.z, sharpPreview);
|
|
112
|
+
float protectedPreview = mix(masks.y, step(0.08, masks.y), sharpPreview);
|
|
113
|
+
vec3 facePreview = vec3(retouchPreview, 0.08, 0.08);
|
|
114
|
+
vec3 featurePreview = vec3(0.05, protectedPreview, 0.1);
|
|
115
|
+
vec3 maskPreview = max(facePreview, featurePreview);
|
|
116
|
+
vec3 debugColor = mix(original * 0.18, maskPreview, max(retouchPreview, protectedPreview));
|
|
117
|
+
gl_FragColor = vec4(debugColor, faceAlpha);
|
|
118
|
+
#include <colorspace_fragment>
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
float effectiveBlurRadius = min(blurRadius, 12.0);
|
|
123
|
+
vec3 smallBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius * 0.45));
|
|
124
|
+
vec3 largeBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius));
|
|
125
|
+
vec3 detail = original - smallBlur;
|
|
126
|
+
float detailAmount = mix(detailPreservation, 0.9, masks.y);
|
|
127
|
+
vec3 smoothed = clamp(largeBlur + detail * detailAmount, 0.0, 1.0);
|
|
128
|
+
vec3 color = mix(original, smoothed, min(retouchAmount, 0.72) * masks.x);
|
|
129
|
+
vec3 blemishAverage = maskedBlurCamera(vUv, max(1.0, blemishRadius));
|
|
130
|
+
color = reduceBlemishes(color, original, blemishAverage, smoothed, masks.x);
|
|
131
|
+
gl_FragColor = vec4(color, faceAlpha);
|
|
132
|
+
#include <colorspace_fragment>
|
|
133
|
+
}
|
|
134
|
+
`,pt=({retouchMask:e,retouchAmount:t,blurRadius:o,detailPreservation:r=.62,blemishReduction:n=.35,blemishRadius:a=3,previewMask:s,protectLandmarks:l,clipMinX:u=0,clipMaxX:c=1,renderOrder:g=Y.FACE_RETOUCH_RENDER_ORDER})=>{const{camera:h,size:S}=oe.useThree(),b=we.useXRCameraTexture(),m=_.useMemo(()=>({cameraTexture:{value:null},retouchMaskTexture:{value:null},texelSize:{value:new f.Vector2(1/1280,1/720)},retouchAmount:{value:0},blurRadius:{value:0},detailPreservation:{value:0},blemishReduction:{value:0},blemishRadius:{value:0},previewMask:{value:0},protectLandmarks:{value:1},clipMinX:{value:0},clipMaxX:{value:1}}),[]),y=_.useMemo(()=>{if(!h.isPerspectiveCamera)return[10,10];const k=h,X=(k.position.z||5)- -1,Te=f.MathUtils.degToRad(k.fov),ae=2*Math.tan(Te/2)*X;return[ae*(S.width/S.height),ae]},[h,S]);return oe.useFrame(()=>{m.cameraTexture.value=b??null,m.retouchMaskTexture.value=e,m.texelSize.value.set(1/Math.max(S.width,1),1/Math.max(S.height,1)),m.retouchAmount.value=t,m.blurRadius.value=o,m.detailPreservation.value=r,m.blemishReduction.value=n,m.blemishRadius.value=a,m.previewMask.value=s?1:0,m.protectLandmarks.value=l?1:0,m.clipMinX.value=u,m.clipMaxX.value=c}),b?M.jsx("group",{position:[0,0,-1],children:M.jsxs("mesh",{renderOrder:g,children:[M.jsx("planeGeometry",{args:y}),M.jsx("shaderMaterial",{uniforms:m,vertexShader:ut,fragmentShader:mt,...ct})]})}):null},dt=e=>{const t=document.createElement("canvas");t.width=e,t.height=e;const o=t.getContext("2d",{willReadFrequently:!1});if(!o)throw new Error("Unable to create face retouch mask context");const r=new f.CanvasTexture(t);return r.colorSpace=f.NoColorSpace,r.minFilter=f.LinearFilter,r.magFilter=f.LinearFilter,r.generateMipmaps=!1,r.needsUpdate=!0,{canvas:t,context:o,texture:r}},ht=(e,t=re.FACE_MASK_SIZE,o={},r=0)=>{const n=_.useMemo(()=>dt(t),[t]);return _.useEffect(()=>{let a=0;const s=()=>{var u,c;a=requestAnimationFrame(s);const l=(c=(u=e==null?void 0:e.detectionResults)==null?void 0:u.faceLandmarks)==null?void 0:c[r];re.drawFaceRetouchMask(n.context,l,t,o),n.texture.needsUpdate=!0};return s(),()=>{cancelAnimationFrame(a)}},[r,e,n.context,n.texture,o,t]),_.useEffect(()=>()=>{n.texture.dispose()},[n.texture]),{canvas:n.canvas,texture:n.texture}},St=[{key:"skinSmoothing",label:"Skin smoothing",type:"number",min:0,max:1,step:.01},{key:"skinRealism",label:"Skin realism",type:"number",min:0,max:1,step:.01},{key:"blemishReduction",label:"Blemish reduction",type:"number",min:0,max:1,step:.01},{key:"previewMask",label:"Preview mask",type:"boolean"}],A={skinSmoothing:.55,skinRealism:.62,blemishReduction:.35,previewMask:!1},L={blurRadius:8,blemishRadius:3,protectLandmarks:!0,foreheadCoverage:!0},G=(e,t)=>{const o=Number(e);return Number.isFinite(o)?Math.min(1,Math.max(0,o)):t},ee=(e={})=>({skinSmoothing:G(e.skinSmoothing,A.skinSmoothing),skinRealism:G(e.skinRealism,A.skinRealism),blemishReduction:G(e.blemishReduction,A.blemishReduction),previewMask:typeof e.previewMask=="boolean"?e.previewMask:A.previewMask}),gt=(e,t)=>ee({...e,...t}),Et=({faceIndex:e,numFaces:t,skinSmoothing:o,skinRealism:r,blemishReduction:n,previewMask:a,clipMinX:s=0,clipMaxX:l=1,renderOrder:u})=>{const c=Y.resolveFaceIndex(e),g=Y.resolveNumFaces(c,t),h=ee({skinSmoothing:o,skinRealism:r,blemishReduction:n,previewMask:a}),S=_.useMemo(()=>({numFaces:g}),[g]),{node:b}=Le.useXRModel(Ce.XRModel.FACE_TRACKER,S),m=_.useMemo(()=>({foreheadCoverage:L.foreheadCoverage}),[]),y=ht(b,void 0,m,c);return M.jsx(pt,{retouchMask:y.texture,retouchAmount:h.skinSmoothing,blurRadius:L.blurRadius,detailPreservation:h.skinRealism,blemishReduction:h.blemishReduction,blemishRadius:L.blemishRadius,previewMask:h.previewMask,protectLandmarks:L.protectLandmarks,clipMinX:s,clipMaxX:l,renderOrder:u})};exports.DEFAULT_FACE_MIRROR_SETTINGS=Fe;exports.DEFAULT_FACE_SWAP_SETTINGS=F;exports.DEFAULT_IRIS_EFFECT_SETTINGS=ce;exports.DEFAULT_LIP_EFFECT_SETTINGS=fe;exports.FACE_MIRROR_SETTINGS_FIELDS=it;exports.FACE_MIRROR_VARIANTS=H;exports.FACE_MIRROR_VARIANT_LABELS=Ae;exports.FACE_RETOUCH_DEFAULT_CONTROLS=A;exports.FACE_RETOUCH_SETTINGS_FIELDS=St;exports.FACE_SWAP_PAINTED_FEATURE_SOFTNESS=ye;exports.FACE_SWAP_PRESETS=N;exports.FACE_SWAP_PRESET_KEYS=Z;exports.FACE_SWAP_SETTINGS_FIELDS=rt;exports.FACE_SWAP_SETTINGS_RANGES=R;exports.FACE_SWAP_SOURCE_KINDS=et;exports.FaceRetouch=Et;exports.IRIS_EFFECT_EYES=ie;exports.IRIS_EFFECT_MODES=le;exports.IRIS_EFFECT_SETTINGS_FIELDS=Ke;exports.LIP_EFFECT_COLOR_MODES=ge;exports.LIP_EFFECT_GRADIENT_DIRECTIONS=Ee;exports.LIP_EFFECT_PRESETS=q;exports.LIP_EFFECT_PRESET_KEYS=V;exports.LIP_EFFECT_SETTINGS_FIELDS=Je;exports.MAKEUP_AUTO_SHADE_REGIONS=ue;exports.MAKEUP_FINISHES=O;exports.MAKEUP_FINISH_DEFAULTS=D;exports.MAKEUP_FINISH_KEYS=me;exports.MAKEUP_REGIONS=je;exports.MAKEUP_SHADES=T;exports.MAKEUP_SHADE_NAMES=pe;exports.MAKEUP_SIDES=ze;exports.MAKEUP_SPARKLE_SIZE_RANGE=P;exports.alphaMapOptions=He;exports.blendModeOptions=Xe;exports.createLipTextureTransform=Qe;exports.defaultFaceSwapPreset=ve;exports.faceMirrorTransferSettings=lt;exports.isFaceMirrorVariant=st;exports.isFaceSwapPresetKey=J;exports.isLipEffectPresetKey=$;exports.isMakeupShadeName=z;exports.makeupNameLabel=W;exports.makeupShadeOptions=Se;exports.maskTextureSourceOptions=Be;exports.materialTypeOptions=Oe;exports.patchFaceMirrorSettings=nt;exports.patchFaceRetouchControls=gt;exports.patchFaceSwapSettings=at;exports.patchIrisEffectSettings=Ye;exports.patchLipEffectSettings=Ze;exports.resolveFaceMirrorSettings=Re;exports.resolveFaceRetouchControls=ee;exports.resolveFaceSwapSettings=j;exports.resolveIrisEffectSettings=Ge;exports.resolveLipEffectSettings=be;exports.resolveMakeupShade=de;exports.resolveMakeupShadePair=he;exports.shaderPresetOptions=De;exports.sideOptions=Ue;exports.supportsAutoMakeupShade=U;exports.textureMapOptions=Ne;
|