@vincentt-xr/sdk 2.0.0-alpha.7 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GROUNDING.md +5651 -82
- package/README.md +1 -0
- package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
- package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
- package/dist/DebuggerUI-7ngnJsBe.js +275 -0
- package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
- package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
- package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
- package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -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/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/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 +69 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
- package/dist/components/BodyTracker/index.d.ts +17 -0
- package/dist/components/BodyTrigger/index.d.ts +49 -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/canonical/CanonicalFaceMeshRenderer.d.ts +37 -5
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +2 -2
- 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/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/HandOccluder.d.ts +55 -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 +101 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +69 -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 +64 -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/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/LipEffect/LipEffect.d.ts +27 -1
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +95 -7
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +46 -4
- package/dist/components/LipEffect/index.d.ts +11 -3
- 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 +128 -9
- 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/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -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 +50 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- 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 +6 -0
- package/dist/components/ScreenImage/types.d.ts +18 -0
- 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 +43 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- 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 +11 -0
- package/dist/config/index.d.ts +0 -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-BH7PdKFS.cjs +1 -0
- package/dist/contexts-jak8-tND.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 +22 -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 +18 -3
- 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 +1 -1
- 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 +1 -1
- 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 +2695 -2547
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +20 -2
- package/dist/entries/face-effects.d.ts +123 -9
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +49 -3
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +60 -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 +14208 -2268
- 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/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-B1otSDMX.cjs +1 -0
- package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +178 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handGestures.d.ts +524 -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/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +76 -1
- 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 +32 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +7 -0
- package/dist/hooks/useXRSession/facade.d.ts +42 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +3 -1
- package/dist/hooks/useXRSession/registry.d.ts +14 -0
- package/dist/hooks/useXRSession/store.d.ts +52 -3
- package/dist/index-B1_TzJaI.js +1104 -0
- package/dist/index-BavF06C6.js +190 -0
- package/dist/index-BfFmpddl.cjs +21 -0
- package/dist/index-BuBzneeW.cjs +46 -0
- package/dist/index-CGsQWodV.cjs +1 -0
- package/dist/index-CIe7eCMH.js +3200 -0
- package/dist/index-CfSF8LXa.cjs +1 -0
- package/dist/index-D5GTzOzD.cjs +1 -0
- package/dist/index-DBhQzvVa.js +314 -0
- package/dist/index-DE17y0ZI.cjs +1 -0
- package/dist/index-JII7huPk.js +442 -0
- package/dist/index-tpCr9CLj.cjs +1 -0
- package/dist/index-w1S7fI2B.js +1432 -0
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-Dmk1cTXq.js → internal-B90P-clC.js} +138 -119
- package/dist/internal-Cjinca64.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +15 -10
- 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-BFDyBnKM.js +224 -0
- package/dist/landmarkMask-u7es2k4X.cjs +1 -0
- package/dist/landmarks-BlUqf5MZ.cjs +1 -0
- package/dist/landmarks-bftdwq6Z.js +76 -0
- package/dist/loaders-BGAUACsd.js +363 -0
- package/dist/loaders-BJ1_QCHt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1190 -675
- package/dist/main.cjs +1 -1
- package/dist/main.js +1190 -452
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +3 -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 +2 -0
- 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 +60 -0
- package/dist/particles/system.d.ts +64 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +774 -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-C8rE26Uf.js +366 -0
- package/dist/providers-DHsrhDI2.cjs +62 -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-KZk6eRiY.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
- package/dist/renderPasses-B6l8IpJv.js +1290 -0
- package/dist/renderPasses-dqmkft4P.cjs +158 -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/segmentation-Cb3ouK6Z.js +1758 -0
- package/dist/segmentation-D9pYO6aR.cjs +1 -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/select-Ck5LGz-J.cjs +1 -0
- package/dist/select-pYRo_win.js +233 -0
- package/dist/selectors-C4X71aoD.cjs +1 -0
- package/dist/selectors-DmNaKIwE.js +196 -0
- package/dist/session-BrH8G7iJ.cjs +31 -0
- package/dist/session-DgA_z6O1.js +418 -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 +62 -0
- package/dist/subjects/types.d.ts +55 -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 +1326 -506
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- 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 +47 -3
- package/dist/types/segmentation.d.ts +24 -0
- package/dist/types/session.d.ts +41 -3
- package/dist/updateThrottle-BseecYag.js +4 -0
- package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
- package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
- package/dist/useFaceInfo-J4x7LsqL.js +76 -0
- package/dist/useFaceResultReader-BvEo5REG.js +61 -0
- package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-Cr3RzuAW.cjs +1 -0
- package/dist/useXRCapabilities-Cxmlmpbd.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/useStableUniforms.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-ByoNj0QP.js → uv-DJU_XfmN.js} +15 -247
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +142 -0
- 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 +17 -11
- 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 +8 -9
- 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 +209 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +535 -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 +98 -0
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +136 -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/screen-space-coordinates.mdx +4 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/trackers.mdx +5 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +51 -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/package.json +23 -1
- package/dist/DebuggerUI-B6bP6P9r.cjs +0 -1
- package/dist/DebuggerUI-BjOMr8q_.js +0 -269
- package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
- package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
- package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
- package/dist/FaceRetouch-DwbKQJAN.js +0 -551
- 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-ByhzppYl.js +0 -663
- package/dist/contexts-Dr62It_K.cjs +0 -1
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-C4QpCQIY.js +0 -118
- package/dist/getFaceInfo-fA1bFBub.cjs +0 -1
- package/dist/index-9dlAQAhy.js +0 -1462
- package/dist/index-BjmTe9eM.cjs +0 -1
- package/dist/index-BpEf2BBb.cjs +0 -1
- package/dist/index-CyUUurQT.cjs +0 -1
- package/dist/index-DCiMbxC3.cjs +0 -1
- package/dist/index-DXT3WccE.js +0 -2089
- package/dist/index-DpI-qo5X.cjs +0 -17
- package/dist/index-DyVF4vEW.js +0 -111
- package/dist/index-VJ0SJwmG.js +0 -214
- package/dist/internal-Cq-TEQ5Y.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-BOoBSr8z.cjs +0 -21
- package/dist/renderPasses-BcquyVtu.js +0 -1500
- package/dist/selectors-B8H97CKA.js +0 -59
- package/dist/selectors-CZLKT2Iv.cjs +0 -1
- package/dist/session-CpkiK5YA.cjs +0 -31
- package/dist/session-DLFN_VII.js +0 -363
- package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
- package/dist/useFaceInfo-Dk426LTu.js +0 -62
- package/dist/useFaceResults-CtetsO9M.js +0 -19
- package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
|
@@ -0,0 +1,1290 @@
|
|
|
1
|
+
import { jsx as f, jsxs as Fe, Fragment as Ye } from "react/jsx-runtime";
|
|
2
|
+
import { useLoader as fe, useThree as Bt, useFrame as zt } from "@react-three/fiber";
|
|
3
|
+
import { useRef as o, useMemo as $, useState as qe, useCallback as He, useEffect as Se } from "react";
|
|
4
|
+
import * as E from "three";
|
|
5
|
+
import { MathUtils as Qe, Color as Ht, Vector2 as Ve } from "three";
|
|
6
|
+
import { C as se, j as Vt, X as Xt, F as jt } from "./index-CIe7eCMH.js";
|
|
7
|
+
import { b as Wt, c as $t, e as Kt } from "./selectors-DmNaKIwE.js";
|
|
8
|
+
import { t as Yt, p as qt, F as Qt } from "./index-BavF06C6.js";
|
|
9
|
+
import { s as Jt } from "./updateThrottle-BseecYag.js";
|
|
10
|
+
import { t as Zt, d as en, e as tn, T as Ee, f as nn, g as sn } from "./index-DBhQzvVa.js";
|
|
11
|
+
import { TransformControls as rn } from "@react-three/drei";
|
|
12
|
+
const an = (e) => {
|
|
13
|
+
const n = o(null);
|
|
14
|
+
if (n.current) {
|
|
15
|
+
const t = n.current;
|
|
16
|
+
Object.keys(e).forEach((s) => {
|
|
17
|
+
t[s].value = e[s];
|
|
18
|
+
});
|
|
19
|
+
} else {
|
|
20
|
+
const t = {};
|
|
21
|
+
Object.keys(e).forEach((s) => {
|
|
22
|
+
t[s] = { value: e[s] };
|
|
23
|
+
}), n.current = t;
|
|
24
|
+
}
|
|
25
|
+
return n.current;
|
|
26
|
+
}, _e = 8, K = {
|
|
27
|
+
type: "linear",
|
|
28
|
+
stops: [
|
|
29
|
+
{ offset: 0, color: "#38bdf8" },
|
|
30
|
+
{ offset: 1, color: "#a78bfa" }
|
|
31
|
+
],
|
|
32
|
+
angle: 0,
|
|
33
|
+
center: { x: 0.5, y: 0.5 },
|
|
34
|
+
radius: 0.5
|
|
35
|
+
}, on = (e) => {
|
|
36
|
+
const n = e.slice(0, _e).map((t) => ({ ...t, offset: Qe.clamp(t.offset, 0, 1) })).sort((t, s) => t.offset - s.offset);
|
|
37
|
+
return n.length >= 2 ? n : K.stops.map((t) => ({ ...t }));
|
|
38
|
+
}, ln = (e) => ({
|
|
39
|
+
...K,
|
|
40
|
+
...e,
|
|
41
|
+
center: { ...K.center, ...e == null ? void 0 : e.center },
|
|
42
|
+
radius: Math.max(0.01, (e == null ? void 0 : e.radius) ?? K.radius),
|
|
43
|
+
stops: on((e == null ? void 0 : e.stops) ?? K.stops)
|
|
44
|
+
}), cn = `
|
|
45
|
+
varying vec2 vPosition;
|
|
46
|
+
void main() {
|
|
47
|
+
vPosition = position.xy;
|
|
48
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
49
|
+
}
|
|
50
|
+
`, fn = `
|
|
51
|
+
#define MAX_STOPS 8
|
|
52
|
+
uniform vec3 stopColors[MAX_STOPS];
|
|
53
|
+
uniform float stopOffsets[MAX_STOPS];
|
|
54
|
+
uniform int stopCount;
|
|
55
|
+
uniform int gradientType;
|
|
56
|
+
uniform vec2 direction;
|
|
57
|
+
uniform vec2 center;
|
|
58
|
+
uniform float radius;
|
|
59
|
+
uniform float angleOffset;
|
|
60
|
+
uniform float opacity;
|
|
61
|
+
varying vec2 vPosition;
|
|
62
|
+
|
|
63
|
+
vec3 sampleGradient(float amount) {
|
|
64
|
+
vec3 color = stopColors[0];
|
|
65
|
+
for (int index = 1; index < MAX_STOPS; index++) {
|
|
66
|
+
if (index >= stopCount) break;
|
|
67
|
+
if (amount <= stopOffsets[index]) {
|
|
68
|
+
float width = max(0.0001, stopOffsets[index] - stopOffsets[index - 1]);
|
|
69
|
+
return mix(stopColors[index - 1], stopColors[index], clamp((amount - stopOffsets[index - 1]) / width, 0.0, 1.0));
|
|
70
|
+
}
|
|
71
|
+
color = stopColors[index];
|
|
72
|
+
}
|
|
73
|
+
return color;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
void main() {
|
|
77
|
+
vec2 delta = vPosition - center;
|
|
78
|
+
float amount;
|
|
79
|
+
if (gradientType == 1) {
|
|
80
|
+
amount = clamp(length(delta) / radius, 0.0, 1.0);
|
|
81
|
+
} else if (gradientType == 2) {
|
|
82
|
+
amount = fract(atan(delta.y, delta.x) / 6.28318530718 + 0.5 + angleOffset);
|
|
83
|
+
} else {
|
|
84
|
+
amount = clamp(dot(delta, direction) + 0.5, 0.0, 1.0);
|
|
85
|
+
}
|
|
86
|
+
gl_FragColor = vec4(sampleGradient(amount), opacity);
|
|
87
|
+
}
|
|
88
|
+
`, un = { linear: 0, radial: 1, angular: 2 }, dn = ({ opacity: e = 1, value: n }) => {
|
|
89
|
+
const t = $(() => {
|
|
90
|
+
const a = ln(n), r = Qe.degToRad(a.angle), i = a.stops.map((h) => new Ht(h.color)), u = a.stops.map((h) => h.offset);
|
|
91
|
+
for (; i.length < _e; ) i.push(i[i.length - 1]);
|
|
92
|
+
for (; u.length < _e; ) u.push(1);
|
|
93
|
+
return {
|
|
94
|
+
stopColors: i,
|
|
95
|
+
stopOffsets: u,
|
|
96
|
+
stopCount: a.stops.length,
|
|
97
|
+
gradientType: un[a.type],
|
|
98
|
+
direction: new Ve(Math.cos(r), Math.sin(r)),
|
|
99
|
+
center: new Ve(a.center.x - 0.5, 0.5 - a.center.y),
|
|
100
|
+
radius: a.radius,
|
|
101
|
+
angleOffset: a.angle / 360,
|
|
102
|
+
opacity: e
|
|
103
|
+
};
|
|
104
|
+
}, [e, n]), s = an(t);
|
|
105
|
+
return /* @__PURE__ */ f(
|
|
106
|
+
"shaderMaterial",
|
|
107
|
+
{
|
|
108
|
+
uniforms: s,
|
|
109
|
+
vertexShader: cn,
|
|
110
|
+
fragmentShader: fn,
|
|
111
|
+
transparent: e < 1,
|
|
112
|
+
depthTest: !1,
|
|
113
|
+
depthWrite: !1,
|
|
114
|
+
toneMapped: !1
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}, mn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO2YpZcAAAAASUVORK5CYII=", ts = {
|
|
118
|
+
source: "solid",
|
|
119
|
+
color: "#ffffff",
|
|
120
|
+
opacity: 1,
|
|
121
|
+
textureUrl: "",
|
|
122
|
+
gradient: K
|
|
123
|
+
}, Je = (e) => ({
|
|
124
|
+
...K,
|
|
125
|
+
stops: [
|
|
126
|
+
{ offset: 0, color: "#ffffff" },
|
|
127
|
+
{ offset: 1, color: e }
|
|
128
|
+
]
|
|
129
|
+
}), hn = ({
|
|
130
|
+
depthTest: e,
|
|
131
|
+
depthWrite: n,
|
|
132
|
+
settings: t,
|
|
133
|
+
side: s,
|
|
134
|
+
toneMapped: a
|
|
135
|
+
}) => {
|
|
136
|
+
const r = fe(
|
|
137
|
+
E.TextureLoader,
|
|
138
|
+
t.textureUrl || mn
|
|
139
|
+
);
|
|
140
|
+
return /* @__PURE__ */ f(
|
|
141
|
+
"meshBasicMaterial",
|
|
142
|
+
{
|
|
143
|
+
color: t.color,
|
|
144
|
+
map: r,
|
|
145
|
+
transparent: !0,
|
|
146
|
+
opacity: t.opacity,
|
|
147
|
+
side: s,
|
|
148
|
+
depthWrite: n,
|
|
149
|
+
depthTest: e,
|
|
150
|
+
toneMapped: a
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}, pn = ({
|
|
154
|
+
depthTest: e = !1,
|
|
155
|
+
depthWrite: n = !1,
|
|
156
|
+
settings: t,
|
|
157
|
+
side: s,
|
|
158
|
+
toneMapped: a = !1
|
|
159
|
+
}) => {
|
|
160
|
+
const r = $(
|
|
161
|
+
() => t.gradient ?? Je(t.color),
|
|
162
|
+
[t.color, t.gradient]
|
|
163
|
+
);
|
|
164
|
+
return t.source === "gradient" ? /* @__PURE__ */ f(dn, { value: r, opacity: t.opacity }) : t.source === "texture" ? /* @__PURE__ */ f(
|
|
165
|
+
hn,
|
|
166
|
+
{
|
|
167
|
+
settings: t,
|
|
168
|
+
side: s,
|
|
169
|
+
depthTest: e,
|
|
170
|
+
depthWrite: n,
|
|
171
|
+
toneMapped: a
|
|
172
|
+
}
|
|
173
|
+
) : /* @__PURE__ */ f(
|
|
174
|
+
"meshBasicMaterial",
|
|
175
|
+
{
|
|
176
|
+
color: t.color,
|
|
177
|
+
transparent: !0,
|
|
178
|
+
opacity: t.opacity,
|
|
179
|
+
side: s,
|
|
180
|
+
depthWrite: n,
|
|
181
|
+
depthTest: e,
|
|
182
|
+
toneMapped: a
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}, Me = Math.PI / 180, ve = 180 / Math.PI, G = (e) => Number(e.toFixed(6)), Xe = {
|
|
186
|
+
enabled: !0,
|
|
187
|
+
linked: {
|
|
188
|
+
position: !1,
|
|
189
|
+
rotation: !1,
|
|
190
|
+
scale: !1
|
|
191
|
+
},
|
|
192
|
+
showTransformControls: !1,
|
|
193
|
+
transformControlMode: "translate",
|
|
194
|
+
transformControlSpace: "local",
|
|
195
|
+
position: { x: 0, y: 0, z: 0 },
|
|
196
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
197
|
+
scale: { x: 1, y: 1, z: 1 },
|
|
198
|
+
visible: !0
|
|
199
|
+
}, ns = ({ children: e, objectRef: n, onChange: t, value: s }) => {
|
|
200
|
+
const a = o(null), r = o(n);
|
|
201
|
+
r.current = n;
|
|
202
|
+
const [i, u] = qe(null), h = He((l) => {
|
|
203
|
+
var F;
|
|
204
|
+
a.current = l, u(l), (F = r.current) == null || F.call(r, l);
|
|
205
|
+
}, []), g = He(() => {
|
|
206
|
+
const l = a.current;
|
|
207
|
+
!l || !t || t({
|
|
208
|
+
...s,
|
|
209
|
+
position: {
|
|
210
|
+
x: G(l.position.x),
|
|
211
|
+
y: G(l.position.y),
|
|
212
|
+
z: G(l.position.z)
|
|
213
|
+
},
|
|
214
|
+
rotation: {
|
|
215
|
+
x: G(l.rotation.x * ve),
|
|
216
|
+
y: G(l.rotation.y * ve),
|
|
217
|
+
z: G(l.rotation.z * ve)
|
|
218
|
+
},
|
|
219
|
+
scale: {
|
|
220
|
+
x: G(l.scale.x),
|
|
221
|
+
y: G(l.scale.y),
|
|
222
|
+
z: G(l.scale.z)
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}, [t, s]);
|
|
226
|
+
return s.enabled ? /* @__PURE__ */ Fe(Ye, { children: [
|
|
227
|
+
/* @__PURE__ */ f(
|
|
228
|
+
"group",
|
|
229
|
+
{
|
|
230
|
+
ref: h,
|
|
231
|
+
position: [s.position.x, s.position.y, s.position.z],
|
|
232
|
+
rotation: [
|
|
233
|
+
s.rotation.x * Me,
|
|
234
|
+
s.rotation.y * Me,
|
|
235
|
+
s.rotation.z * Me
|
|
236
|
+
],
|
|
237
|
+
scale: [s.scale.x, s.scale.y, s.scale.z],
|
|
238
|
+
visible: s.visible,
|
|
239
|
+
children: e
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
i && s.showTransformControls && /* @__PURE__ */ f(
|
|
243
|
+
rn,
|
|
244
|
+
{
|
|
245
|
+
object: i,
|
|
246
|
+
mode: s.transformControlMode,
|
|
247
|
+
space: s.transformControlSpace,
|
|
248
|
+
size: 0.85,
|
|
249
|
+
onMouseUp: g,
|
|
250
|
+
onObjectChange: g
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
] }) : null;
|
|
254
|
+
}, y = {
|
|
255
|
+
basic: "basic",
|
|
256
|
+
standard: "standard",
|
|
257
|
+
physical: "physical",
|
|
258
|
+
toon: "toon",
|
|
259
|
+
normal: "normal",
|
|
260
|
+
matcap: "matcap",
|
|
261
|
+
wireframe: "wireframe",
|
|
262
|
+
shader: "shader"
|
|
263
|
+
}, H = {
|
|
264
|
+
originalFace: "originalFace",
|
|
265
|
+
composite: "composite"
|
|
266
|
+
}, V = {
|
|
267
|
+
none: "none",
|
|
268
|
+
canonical: "canonical",
|
|
269
|
+
style2: "style2"
|
|
270
|
+
}, Q = {
|
|
271
|
+
none: "none",
|
|
272
|
+
canonical: "canonical"
|
|
273
|
+
}, re = {
|
|
274
|
+
solid: "solid",
|
|
275
|
+
gradient: "gradient",
|
|
276
|
+
imageUrl: "imageUrl",
|
|
277
|
+
mediaUrl: "mediaUrl"
|
|
278
|
+
}, ne = {
|
|
279
|
+
front: "front",
|
|
280
|
+
back: "back",
|
|
281
|
+
double: "double"
|
|
282
|
+
}, Ze = {
|
|
283
|
+
normal: "normal",
|
|
284
|
+
add: "add",
|
|
285
|
+
subtract: "subtract",
|
|
286
|
+
multiply: "multiply",
|
|
287
|
+
screen: "screen",
|
|
288
|
+
overlay: "overlay",
|
|
289
|
+
softLight: "softLight",
|
|
290
|
+
hardLight: "hardLight",
|
|
291
|
+
lighten: "lighten",
|
|
292
|
+
darken: "darken",
|
|
293
|
+
difference: "difference",
|
|
294
|
+
exclusion: "exclusion"
|
|
295
|
+
}, yn = {
|
|
296
|
+
textureMap: V.canonical,
|
|
297
|
+
alphaMap: Q.canonical,
|
|
298
|
+
alphaOpacity: 1
|
|
299
|
+
}, je = {
|
|
300
|
+
...yn,
|
|
301
|
+
blendMode: Ze.hardLight,
|
|
302
|
+
blendOpacity: 0.85,
|
|
303
|
+
baseColor: "#ffffff",
|
|
304
|
+
opacity: 1,
|
|
305
|
+
compositeShading: !0
|
|
306
|
+
}, O = {
|
|
307
|
+
materialType: y.basic,
|
|
308
|
+
shaderPreset: H.originalFace,
|
|
309
|
+
textureMap: V.none,
|
|
310
|
+
alphaMap: Q.none,
|
|
311
|
+
alphaOpacity: 1,
|
|
312
|
+
side: ne.front,
|
|
313
|
+
blendMode: Ze.normal,
|
|
314
|
+
blendOpacity: 1,
|
|
315
|
+
baseColor: "#38bdf8",
|
|
316
|
+
opacity: 0.45,
|
|
317
|
+
compositeShading: !1
|
|
318
|
+
};
|
|
319
|
+
y.shader, H.composite, ne.front;
|
|
320
|
+
const Ae = {
|
|
321
|
+
mouth: !0,
|
|
322
|
+
eyes: !0,
|
|
323
|
+
nose: !0
|
|
324
|
+
}, J = {
|
|
325
|
+
textureSource: re.solid,
|
|
326
|
+
color: "#111111",
|
|
327
|
+
opacity: 0.5
|
|
328
|
+
}, gn = 24, et = 10, Ue = (e, n, t) => e !== y.shader ? "none" : n === H.originalFace ? "originalFace" : n === H.composite ? t === V.none ? "originalFace" : "composite" : "none", ss = (e, n) => e === y.basic || e === y.standard || e === y.physical || e === y.toon || e === y.shader && n === H.composite, rs = (e, n, t = V.canonical) => Ue(e, n, t) === "composite", bn = (e, n, t) => Ue(e, n, t) === "originalFace", Ce = (e) => e === re.imageUrl || e === re.mediaUrl, En = (e) => e === re.solid || e === re.gradient, xe = /* @__PURE__ */ new Set([
|
|
329
|
+
61,
|
|
330
|
+
146,
|
|
331
|
+
91,
|
|
332
|
+
181,
|
|
333
|
+
84,
|
|
334
|
+
17,
|
|
335
|
+
314,
|
|
336
|
+
405,
|
|
337
|
+
321,
|
|
338
|
+
375,
|
|
339
|
+
291,
|
|
340
|
+
78,
|
|
341
|
+
95,
|
|
342
|
+
88,
|
|
343
|
+
178,
|
|
344
|
+
87,
|
|
345
|
+
14,
|
|
346
|
+
317,
|
|
347
|
+
402,
|
|
348
|
+
318,
|
|
349
|
+
324,
|
|
350
|
+
308,
|
|
351
|
+
191,
|
|
352
|
+
80,
|
|
353
|
+
81,
|
|
354
|
+
82,
|
|
355
|
+
13,
|
|
356
|
+
312,
|
|
357
|
+
311,
|
|
358
|
+
310,
|
|
359
|
+
415
|
|
360
|
+
]), We = [
|
|
361
|
+
61,
|
|
362
|
+
146,
|
|
363
|
+
91,
|
|
364
|
+
181,
|
|
365
|
+
84,
|
|
366
|
+
17,
|
|
367
|
+
314,
|
|
368
|
+
405,
|
|
369
|
+
321,
|
|
370
|
+
375,
|
|
371
|
+
291,
|
|
372
|
+
409,
|
|
373
|
+
270,
|
|
374
|
+
269,
|
|
375
|
+
267,
|
|
376
|
+
0,
|
|
377
|
+
37,
|
|
378
|
+
39,
|
|
379
|
+
40,
|
|
380
|
+
185
|
|
381
|
+
], $e = [
|
|
382
|
+
78,
|
|
383
|
+
95,
|
|
384
|
+
88,
|
|
385
|
+
178,
|
|
386
|
+
87,
|
|
387
|
+
14,
|
|
388
|
+
317,
|
|
389
|
+
402,
|
|
390
|
+
318,
|
|
391
|
+
324,
|
|
392
|
+
308,
|
|
393
|
+
415,
|
|
394
|
+
310,
|
|
395
|
+
311,
|
|
396
|
+
312,
|
|
397
|
+
13,
|
|
398
|
+
82,
|
|
399
|
+
81,
|
|
400
|
+
80,
|
|
401
|
+
191
|
|
402
|
+
], Te = /* @__PURE__ */ new Set([
|
|
403
|
+
33,
|
|
404
|
+
7,
|
|
405
|
+
163,
|
|
406
|
+
144,
|
|
407
|
+
145,
|
|
408
|
+
153,
|
|
409
|
+
154,
|
|
410
|
+
155,
|
|
411
|
+
133,
|
|
412
|
+
173,
|
|
413
|
+
157,
|
|
414
|
+
158,
|
|
415
|
+
159,
|
|
416
|
+
160,
|
|
417
|
+
161,
|
|
418
|
+
246
|
|
419
|
+
]), Re = /* @__PURE__ */ new Set([
|
|
420
|
+
362,
|
|
421
|
+
382,
|
|
422
|
+
381,
|
|
423
|
+
380,
|
|
424
|
+
374,
|
|
425
|
+
373,
|
|
426
|
+
390,
|
|
427
|
+
249,
|
|
428
|
+
263,
|
|
429
|
+
466,
|
|
430
|
+
388,
|
|
431
|
+
387,
|
|
432
|
+
386,
|
|
433
|
+
385,
|
|
434
|
+
384,
|
|
435
|
+
398
|
|
436
|
+
]), Mn = [814, 815, 816, 817, 818, 819, 830, 831, 832, 833], vn = new Set(Mn), An = (e, n, t) => {
|
|
437
|
+
const s = xe.has(e) && xe.has(n) && xe.has(t), a = Te.has(e) && Te.has(n) && Te.has(t), r = Re.has(e) && Re.has(n) && Re.has(t);
|
|
438
|
+
return s ? "mouth" : a ? "leftEye" : r ? "rightEye" : "base";
|
|
439
|
+
}, xn = (e) => {
|
|
440
|
+
const n = [], t = [], s = [], a = [], r = [], i = [], u = [], h = [];
|
|
441
|
+
let g = 0, l = 0;
|
|
442
|
+
e.split(`
|
|
443
|
+
`).forEach((b) => {
|
|
444
|
+
const k = b.trim();
|
|
445
|
+
if (!k) return;
|
|
446
|
+
if (k.startsWith("v ")) {
|
|
447
|
+
g += 1;
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
if (k.startsWith("vt ")) {
|
|
451
|
+
const [, _, m] = k.split(/\s+/);
|
|
452
|
+
u.push([Number(_), Number(m)]);
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
if (!k.startsWith("f ")) return;
|
|
456
|
+
const S = l;
|
|
457
|
+
l += 1;
|
|
458
|
+
const [, ...L] = k.split(/\s+/), I = L.map((_) => {
|
|
459
|
+
const [m, M] = _.split("/"), p = Number(m) - 1, T = Number(M) - 1;
|
|
460
|
+
return T >= 0 && u[T] && !h[p] && (h[p] = u[T]), p;
|
|
461
|
+
});
|
|
462
|
+
if (!(I.length < 3))
|
|
463
|
+
for (let _ = 1; _ < I.length - 1; _ += 1) {
|
|
464
|
+
const m = I[0], M = I[_], p = I[_ + 1];
|
|
465
|
+
n.push(m, M, p);
|
|
466
|
+
const T = An(m, M, p);
|
|
467
|
+
vn.has(S) ? i.push(m, M, p) : T === "mouth" ? s.push(m, M, p) : T === "leftEye" ? a.push(m, M, p) : T === "rightEye" ? r.push(m, M, p) : t.push(m, M, p);
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
const F = [];
|
|
471
|
+
for (let b = 0; b < g; b += 1) {
|
|
472
|
+
const [k, S] = h[b] ?? [0, 0];
|
|
473
|
+
F.push(k, S);
|
|
474
|
+
}
|
|
475
|
+
const U = new Uint16Array(a), X = new Uint16Array(r), A = new Uint16Array(a.length + r.length);
|
|
476
|
+
A.set(U), A.set(X, U.length);
|
|
477
|
+
const x = Zt(
|
|
478
|
+
en(n, We, $e),
|
|
479
|
+
n
|
|
480
|
+
);
|
|
481
|
+
return {
|
|
482
|
+
baseIndices: new Uint16Array(t),
|
|
483
|
+
mouthIndices: new Uint16Array(s),
|
|
484
|
+
lipIndices: x,
|
|
485
|
+
lipEdgeDistance: tn(
|
|
486
|
+
x,
|
|
487
|
+
g,
|
|
488
|
+
We,
|
|
489
|
+
$e
|
|
490
|
+
),
|
|
491
|
+
leftEyeIndices: U,
|
|
492
|
+
rightEyeIndices: X,
|
|
493
|
+
eyeIndices: A,
|
|
494
|
+
noseIndices: new Uint16Array(i),
|
|
495
|
+
uvs: new Float32Array(F),
|
|
496
|
+
vertexCount: g
|
|
497
|
+
};
|
|
498
|
+
}, Tn = "canonical_face_model.obj", Rn = new TextDecoder("utf-8"), ke = /* @__PURE__ */ new Map(), kn = (e) => {
|
|
499
|
+
const n = ke.get(e);
|
|
500
|
+
if (n) return n;
|
|
501
|
+
const t = Vt(e).then((s) => xn(Rn.decode(s))).catch((s) => {
|
|
502
|
+
throw ke.delete(e), s;
|
|
503
|
+
});
|
|
504
|
+
return ke.set(e, t), t;
|
|
505
|
+
}, Sn = (e) => {
|
|
506
|
+
const { mesh: n, url: t } = e ?? {}, s = t ?? `${se.sdkAssetsBaseUrl}/${Tn}`, [a, r] = qe(n ?? null);
|
|
507
|
+
return Se(() => {
|
|
508
|
+
if (n) {
|
|
509
|
+
r(n);
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
let i = !1;
|
|
513
|
+
return kn(s).then((u) => {
|
|
514
|
+
i || r(u);
|
|
515
|
+
}).catch((u) => {
|
|
516
|
+
i || console.error(`${se.loggerPrefix} canonical face mesh load failed`, u);
|
|
517
|
+
}), () => {
|
|
518
|
+
i = !0;
|
|
519
|
+
};
|
|
520
|
+
}, [n, s]), a;
|
|
521
|
+
}, Ke = {
|
|
522
|
+
normal: 0,
|
|
523
|
+
add: 1,
|
|
524
|
+
subtract: 2,
|
|
525
|
+
multiply: 3,
|
|
526
|
+
screen: 4,
|
|
527
|
+
overlay: 5,
|
|
528
|
+
softLight: 6,
|
|
529
|
+
hardLight: 7,
|
|
530
|
+
lighten: 8,
|
|
531
|
+
darken: 9,
|
|
532
|
+
difference: 10,
|
|
533
|
+
exclusion: 11
|
|
534
|
+
}, _n = `
|
|
535
|
+
attribute vec2 faceUv;
|
|
536
|
+
varying vec2 vUv;
|
|
537
|
+
varying vec2 vFaceUv;
|
|
538
|
+
varying vec3 vNormal;
|
|
539
|
+
|
|
540
|
+
void main() {
|
|
541
|
+
vUv = uv;
|
|
542
|
+
vFaceUv = faceUv;
|
|
543
|
+
vNormal = normalize(normalMatrix * normal);
|
|
544
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
545
|
+
}
|
|
546
|
+
`, Cn = `
|
|
547
|
+
uniform sampler2D cameraTexture;
|
|
548
|
+
uniform sampler2D canonicalTexture;
|
|
549
|
+
uniform sampler2D alphaMask;
|
|
550
|
+
uniform vec3 textureTint;
|
|
551
|
+
uniform float opacity;
|
|
552
|
+
uniform int blendMode;
|
|
553
|
+
uniform float blendOpacity;
|
|
554
|
+
uniform float useCanonicalTexture;
|
|
555
|
+
uniform float useAlphaMask;
|
|
556
|
+
uniform float alphaOpacity;
|
|
557
|
+
uniform float compositeShading;
|
|
558
|
+
uniform vec3 lightDirection;
|
|
559
|
+
uniform float ambientStrength;
|
|
560
|
+
uniform float directionalStrength;
|
|
561
|
+
varying vec2 vUv;
|
|
562
|
+
varying vec2 vFaceUv;
|
|
563
|
+
varying vec3 vNormal;
|
|
564
|
+
|
|
565
|
+
vec3 linearToSrgb(vec3 value) {
|
|
566
|
+
vec3 low = value * 12.92;
|
|
567
|
+
vec3 high = 1.055 * pow(max(value, vec3(0.0)), vec3(1.0 / 2.4)) - 0.055;
|
|
568
|
+
return mix(high, low, step(value, vec3(0.0031308)));
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
vec3 srgbToLinear(vec3 value) {
|
|
572
|
+
vec3 low = value / 12.92;
|
|
573
|
+
vec3 high = pow(max((value + 0.055) / 1.055, vec3(0.0)), vec3(2.4));
|
|
574
|
+
return mix(high, low, step(value, vec3(0.04045)));
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
float overlayChannel(float base, float blend) {
|
|
578
|
+
return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
float hardLightChannel(float base, float blend) {
|
|
582
|
+
return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
float softLightChannel(float base, float blend) {
|
|
586
|
+
if (blend <= 0.5) {
|
|
587
|
+
return base - (1.0 - 2.0 * blend) * base * (1.0 - base);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
float d = base <= 0.25
|
|
591
|
+
? ((16.0 * base - 12.0) * base + 4.0) * base
|
|
592
|
+
: sqrt(base);
|
|
593
|
+
|
|
594
|
+
return base + (2.0 * blend - 1.0) * (d - base);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
vec3 applyBlendMode(vec3 base, vec3 blend, int mode) {
|
|
598
|
+
if (mode == 0) return blend;
|
|
599
|
+
if (mode == 1) return min(base + blend, 1.0);
|
|
600
|
+
if (mode == 2) return max(base - blend, 0.0);
|
|
601
|
+
if (mode == 3) return base * blend;
|
|
602
|
+
if (mode == 4) return 1.0 - (1.0 - base) * (1.0 - blend);
|
|
603
|
+
if (mode == 5) {
|
|
604
|
+
return vec3(
|
|
605
|
+
overlayChannel(base.r, blend.r),
|
|
606
|
+
overlayChannel(base.g, blend.g),
|
|
607
|
+
overlayChannel(base.b, blend.b)
|
|
608
|
+
);
|
|
609
|
+
}
|
|
610
|
+
if (mode == 6) {
|
|
611
|
+
return vec3(
|
|
612
|
+
softLightChannel(base.r, blend.r),
|
|
613
|
+
softLightChannel(base.g, blend.g),
|
|
614
|
+
softLightChannel(base.b, blend.b)
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
if (mode == 7) {
|
|
618
|
+
return vec3(
|
|
619
|
+
hardLightChannel(base.r, blend.r),
|
|
620
|
+
hardLightChannel(base.g, blend.g),
|
|
621
|
+
hardLightChannel(base.b, blend.b)
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
if (mode == 8) return max(base, blend);
|
|
625
|
+
if (mode == 9) return min(base, blend);
|
|
626
|
+
if (mode == 10) return abs(base - blend);
|
|
627
|
+
return base + blend - 2.0 * base * blend;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
void main() {
|
|
631
|
+
vec3 base = linearToSrgb(texture2D(cameraTexture, vFaceUv).rgb);
|
|
632
|
+
vec4 textureSample = texture2D(canonicalTexture, vUv);
|
|
633
|
+
vec3 blend = linearToSrgb(textureSample.rgb) * textureTint;
|
|
634
|
+
float light = ambientStrength + max(dot(normalize(vNormal), normalize(lightDirection)), 0.0) * directionalStrength;
|
|
635
|
+
blend *= mix(1.0, clamp(light, 0.35, 1.35), compositeShading);
|
|
636
|
+
float maskSample = texture2D(alphaMask, vUv).r;
|
|
637
|
+
float mask = useAlphaMask > 0.5 ? mix(1.0, maskSample, alphaOpacity) : 1.0;
|
|
638
|
+
float textureAlpha = useCanonicalTexture > 0.5 ? textureSample.a : 1.0;
|
|
639
|
+
vec3 blended = applyBlendMode(base, blend, blendMode);
|
|
640
|
+
vec3 color = useCanonicalTexture > 0.5 ? mix(base, blended, blendOpacity) : base;
|
|
641
|
+
gl_FragColor = vec4(srgbToLinear(color), opacity * mask * textureAlpha);
|
|
642
|
+
// Blending above runs in sRGB; the result is linear here and three only
|
|
643
|
+
// encodes built-in materials, so encode for the output colour space.
|
|
644
|
+
#include <colorspace_fragment>
|
|
645
|
+
}
|
|
646
|
+
`, Fn = ({
|
|
647
|
+
alphaMap: e,
|
|
648
|
+
alphaOpacity: n,
|
|
649
|
+
blendMode: t,
|
|
650
|
+
blendOpacity: s,
|
|
651
|
+
cameraTexture: a,
|
|
652
|
+
color: r,
|
|
653
|
+
compositeShading: i,
|
|
654
|
+
faceAlphaMaskUrl: u,
|
|
655
|
+
faceTextureStyle2Url: h,
|
|
656
|
+
faceTextureUrl: g,
|
|
657
|
+
masked: l = !1,
|
|
658
|
+
maskColor: F,
|
|
659
|
+
maskOpacity: U,
|
|
660
|
+
maskSourceUrl: X,
|
|
661
|
+
maskTextureSource: A,
|
|
662
|
+
materialType: x,
|
|
663
|
+
opacity: b,
|
|
664
|
+
shaderPreset: k,
|
|
665
|
+
side: S,
|
|
666
|
+
textureMap: L
|
|
667
|
+
}) => {
|
|
668
|
+
const I = fe(
|
|
669
|
+
E.TextureLoader,
|
|
670
|
+
g || Ee
|
|
671
|
+
), _ = fe(
|
|
672
|
+
E.TextureLoader,
|
|
673
|
+
h || g || Ee
|
|
674
|
+
), m = fe(
|
|
675
|
+
E.TextureLoader,
|
|
676
|
+
u || Ee
|
|
677
|
+
), M = $(() => nn(), []), p = $(() => sn(), []);
|
|
678
|
+
Se(
|
|
679
|
+
() => () => {
|
|
680
|
+
M.dispose(), p.dispose();
|
|
681
|
+
},
|
|
682
|
+
[p, M]
|
|
683
|
+
);
|
|
684
|
+
const T = L === V.style2 ? _ : I, j = L !== V.none, ae = Ue(x, k, L), ue = [
|
|
685
|
+
"composite-material",
|
|
686
|
+
L,
|
|
687
|
+
e,
|
|
688
|
+
n,
|
|
689
|
+
t,
|
|
690
|
+
s,
|
|
691
|
+
i ? "lit" : "flat",
|
|
692
|
+
r,
|
|
693
|
+
b,
|
|
694
|
+
g,
|
|
695
|
+
h,
|
|
696
|
+
u
|
|
697
|
+
].join("|"), B = {
|
|
698
|
+
side: S,
|
|
699
|
+
transparent: !0,
|
|
700
|
+
opacity: b,
|
|
701
|
+
wireframe: !1
|
|
702
|
+
}, de = $(
|
|
703
|
+
() => ({
|
|
704
|
+
source: Ce(A) ? "texture" : A,
|
|
705
|
+
color: En(A) ? F : "#ffffff",
|
|
706
|
+
opacity: U,
|
|
707
|
+
textureUrl: Ce(A) ? X : "",
|
|
708
|
+
gradient: Je(F)
|
|
709
|
+
}),
|
|
710
|
+
[F, U, X, A]
|
|
711
|
+
), v = $(
|
|
712
|
+
() => ({
|
|
713
|
+
cameraTexture: { value: null },
|
|
714
|
+
canonicalTexture: { value: null },
|
|
715
|
+
alphaMask: { value: null },
|
|
716
|
+
textureTint: { value: new E.Color(r) },
|
|
717
|
+
opacity: { value: b },
|
|
718
|
+
blendMode: { value: Ke[t] },
|
|
719
|
+
blendOpacity: { value: s },
|
|
720
|
+
useCanonicalTexture: { value: j ? 1 : 0 },
|
|
721
|
+
useAlphaMask: { value: e === Q.canonical ? 1 : 0 },
|
|
722
|
+
alphaOpacity: { value: n },
|
|
723
|
+
compositeShading: { value: i ? 1 : 0 },
|
|
724
|
+
lightDirection: { value: new E.Vector3(0.3, 0.65, 0.7).normalize() },
|
|
725
|
+
ambientStrength: { value: 0.78 },
|
|
726
|
+
directionalStrength: { value: 0.38 }
|
|
727
|
+
}),
|
|
728
|
+
[
|
|
729
|
+
e,
|
|
730
|
+
n,
|
|
731
|
+
t,
|
|
732
|
+
s,
|
|
733
|
+
r,
|
|
734
|
+
i,
|
|
735
|
+
j,
|
|
736
|
+
b
|
|
737
|
+
]
|
|
738
|
+
);
|
|
739
|
+
if (Se(() => {
|
|
740
|
+
v.cameraTexture.value = a ?? I, v.canonicalTexture.value = T, v.alphaMask.value = m, v.textureTint.value.set(r), v.opacity.value = b, v.blendMode.value = Ke[t], v.blendOpacity.value = s, v.useCanonicalTexture.value = j ? 1 : 0, v.useAlphaMask.value = e === Q.canonical ? 1 : 0, v.alphaOpacity.value = n, v.compositeShading.value = i ? 1 : 0;
|
|
741
|
+
}, [
|
|
742
|
+
e,
|
|
743
|
+
m,
|
|
744
|
+
n,
|
|
745
|
+
t,
|
|
746
|
+
s,
|
|
747
|
+
a,
|
|
748
|
+
r,
|
|
749
|
+
i,
|
|
750
|
+
v,
|
|
751
|
+
I,
|
|
752
|
+
j,
|
|
753
|
+
b,
|
|
754
|
+
T
|
|
755
|
+
]), l)
|
|
756
|
+
return /* @__PURE__ */ f(
|
|
757
|
+
pn,
|
|
758
|
+
{
|
|
759
|
+
settings: de,
|
|
760
|
+
side: S
|
|
761
|
+
},
|
|
762
|
+
`masked-${A}-material`
|
|
763
|
+
);
|
|
764
|
+
if (x === y.wireframe)
|
|
765
|
+
return /* @__PURE__ */ f(
|
|
766
|
+
"meshBasicMaterial",
|
|
767
|
+
{
|
|
768
|
+
color: r,
|
|
769
|
+
transparent: !0,
|
|
770
|
+
opacity: b,
|
|
771
|
+
side: S,
|
|
772
|
+
depthWrite: !1,
|
|
773
|
+
depthTest: !1,
|
|
774
|
+
wireframe: !0,
|
|
775
|
+
toneMapped: !1
|
|
776
|
+
},
|
|
777
|
+
"wireframe-material"
|
|
778
|
+
);
|
|
779
|
+
if (ae === "originalFace" && a)
|
|
780
|
+
return /* @__PURE__ */ f(
|
|
781
|
+
"meshBasicMaterial",
|
|
782
|
+
{
|
|
783
|
+
map: a,
|
|
784
|
+
alphaMap: m,
|
|
785
|
+
transparent: !0,
|
|
786
|
+
opacity: b,
|
|
787
|
+
side: S,
|
|
788
|
+
depthWrite: !1,
|
|
789
|
+
depthTest: !0,
|
|
790
|
+
toneMapped: !1
|
|
791
|
+
},
|
|
792
|
+
"use-original-face-material"
|
|
793
|
+
);
|
|
794
|
+
if (ae === "composite" && a)
|
|
795
|
+
return /* @__PURE__ */ f(
|
|
796
|
+
"shaderMaterial",
|
|
797
|
+
{
|
|
798
|
+
uniforms: v,
|
|
799
|
+
vertexShader: _n,
|
|
800
|
+
fragmentShader: Cn,
|
|
801
|
+
transparent: !0,
|
|
802
|
+
side: S,
|
|
803
|
+
depthWrite: !1,
|
|
804
|
+
depthTest: !0,
|
|
805
|
+
toneMapped: !1
|
|
806
|
+
},
|
|
807
|
+
ue
|
|
808
|
+
);
|
|
809
|
+
const Y = j ? T : null, z = e === Q.canonical && n > 0 ? m : null, q = `${x}-${L}-${e}-${n > 0 ? "alpha-on" : "alpha-off"}`;
|
|
810
|
+
return x === y.standard ? /* @__PURE__ */ f(
|
|
811
|
+
"meshStandardMaterial",
|
|
812
|
+
{
|
|
813
|
+
...B,
|
|
814
|
+
color: r,
|
|
815
|
+
map: Y ?? void 0,
|
|
816
|
+
alphaMap: z ?? void 0,
|
|
817
|
+
depthWrite: !0,
|
|
818
|
+
depthTest: !0,
|
|
819
|
+
metalness: 0.05,
|
|
820
|
+
roughness: 0.72
|
|
821
|
+
},
|
|
822
|
+
q
|
|
823
|
+
) : x === y.physical ? /* @__PURE__ */ f(
|
|
824
|
+
"meshPhysicalMaterial",
|
|
825
|
+
{
|
|
826
|
+
...B,
|
|
827
|
+
color: r,
|
|
828
|
+
map: Y ?? void 0,
|
|
829
|
+
alphaMap: z ?? void 0,
|
|
830
|
+
depthWrite: !0,
|
|
831
|
+
depthTest: !0,
|
|
832
|
+
roughness: 0.58,
|
|
833
|
+
metalness: 0.08,
|
|
834
|
+
clearcoat: 0.35,
|
|
835
|
+
clearcoatRoughness: 0.4
|
|
836
|
+
},
|
|
837
|
+
q
|
|
838
|
+
) : x === y.toon ? /* @__PURE__ */ f(
|
|
839
|
+
"meshToonMaterial",
|
|
840
|
+
{
|
|
841
|
+
...B,
|
|
842
|
+
color: r,
|
|
843
|
+
map: Y ?? void 0,
|
|
844
|
+
alphaMap: z ?? void 0,
|
|
845
|
+
gradientMap: M,
|
|
846
|
+
depthWrite: !0,
|
|
847
|
+
depthTest: !0
|
|
848
|
+
},
|
|
849
|
+
q
|
|
850
|
+
) : x === y.normal ? /* @__PURE__ */ f(
|
|
851
|
+
"meshNormalMaterial",
|
|
852
|
+
{
|
|
853
|
+
...B,
|
|
854
|
+
depthWrite: !0,
|
|
855
|
+
depthTest: !0,
|
|
856
|
+
flatShading: !1
|
|
857
|
+
},
|
|
858
|
+
"normal-material"
|
|
859
|
+
) : x === y.matcap ? /* @__PURE__ */ f(
|
|
860
|
+
"meshMatcapMaterial",
|
|
861
|
+
{
|
|
862
|
+
...B,
|
|
863
|
+
color: r,
|
|
864
|
+
matcap: p,
|
|
865
|
+
depthWrite: !0,
|
|
866
|
+
depthTest: !0
|
|
867
|
+
},
|
|
868
|
+
"matcap-material"
|
|
869
|
+
) : /* @__PURE__ */ f(
|
|
870
|
+
"meshBasicMaterial",
|
|
871
|
+
{
|
|
872
|
+
...B,
|
|
873
|
+
color: r,
|
|
874
|
+
map: Y ?? void 0,
|
|
875
|
+
alphaMap: z ?? void 0,
|
|
876
|
+
depthWrite: !1,
|
|
877
|
+
depthTest: L !== V.none || e !== Q.none,
|
|
878
|
+
toneMapped: !1
|
|
879
|
+
},
|
|
880
|
+
q
|
|
881
|
+
);
|
|
882
|
+
}, Un = [
|
|
883
|
+
{
|
|
884
|
+
key: "base",
|
|
885
|
+
getIndices: (e) => e.baseIndices,
|
|
886
|
+
masked: !1,
|
|
887
|
+
renderOrderOffset: 0
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
key: "mouth",
|
|
891
|
+
getIndices: (e) => e.mouthIndices,
|
|
892
|
+
masked: !1,
|
|
893
|
+
renderOrderOffset: 2
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
key: "lips",
|
|
897
|
+
getIndices: (e) => e.lipIndices,
|
|
898
|
+
masked: !1,
|
|
899
|
+
renderOrderOffset: 3
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
key: "left-eye",
|
|
903
|
+
getIndices: (e) => e.leftEyeIndices,
|
|
904
|
+
masked: !1,
|
|
905
|
+
renderOrderOffset: 2
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
key: "right-eye",
|
|
909
|
+
getIndices: (e) => e.rightEyeIndices,
|
|
910
|
+
masked: !1,
|
|
911
|
+
renderOrderOffset: 2
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
key: "nose",
|
|
915
|
+
getIndices: (e) => e.noseIndices,
|
|
916
|
+
masked: !1,
|
|
917
|
+
renderOrderOffset: 2
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
key: "mouth-mask",
|
|
921
|
+
getIndices: (e) => e.mouthIndices,
|
|
922
|
+
masked: !0,
|
|
923
|
+
renderOrderOffset: 3
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
key: "left-eye-mask",
|
|
927
|
+
getIndices: (e) => e.leftEyeIndices,
|
|
928
|
+
masked: !0,
|
|
929
|
+
renderOrderOffset: 3
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
key: "right-eye-mask",
|
|
933
|
+
getIndices: (e) => e.rightEyeIndices,
|
|
934
|
+
masked: !0,
|
|
935
|
+
renderOrderOffset: 3
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
key: "nose-mask",
|
|
939
|
+
getIndices: (e) => e.noseIndices,
|
|
940
|
+
masked: !0,
|
|
941
|
+
renderOrderOffset: 3
|
|
942
|
+
}
|
|
943
|
+
], In = (e, n) => n ? {
|
|
944
|
+
"left-eye": e.leftEye,
|
|
945
|
+
"right-eye": e.rightEye,
|
|
946
|
+
"left-eye-mask": e.leftEyeMask,
|
|
947
|
+
"right-eye-mask": e.rightEyeMask
|
|
948
|
+
} : {
|
|
949
|
+
"left-eye": e.rightEye,
|
|
950
|
+
"right-eye": e.leftEye,
|
|
951
|
+
"left-eye-mask": e.rightEyeMask,
|
|
952
|
+
"right-eye-mask": e.leftEyeMask
|
|
953
|
+
}, On = {
|
|
954
|
+
[ne.front]: E.FrontSide,
|
|
955
|
+
[ne.back]: E.BackSide,
|
|
956
|
+
[ne.double]: E.DoubleSide
|
|
957
|
+
}, Ln = (e) => ({
|
|
958
|
+
position: new E.BufferAttribute(new Float32Array(e.vertexCount * 3), 3),
|
|
959
|
+
uv: new E.BufferAttribute(new Float32Array(e.uvs), 2),
|
|
960
|
+
faceUv: new E.BufferAttribute(new Float32Array(e.vertexCount * 2), 2),
|
|
961
|
+
lipEdge: new E.BufferAttribute(new Float32Array(e.lipEdgeDistance), 1)
|
|
962
|
+
}), wn = (e, n, t) => {
|
|
963
|
+
e.setAttribute("position", n.position), e.setAttribute("uv", n.uv), e.setAttribute("faceUv", n.faceUv), e.setAttribute("lipEdge", n.lipEdge), e.setIndex(new E.BufferAttribute(t, 1));
|
|
964
|
+
}, Dn = ({
|
|
965
|
+
faceIndex: e = 0,
|
|
966
|
+
baseColor: n,
|
|
967
|
+
color: t = O.baseColor,
|
|
968
|
+
opacity: s = O.opacity,
|
|
969
|
+
materialType: a = O.materialType,
|
|
970
|
+
shaderPreset: r = O.shaderPreset,
|
|
971
|
+
textureMap: i = O.textureMap,
|
|
972
|
+
alphaMap: u = O.alphaMap,
|
|
973
|
+
alphaOpacity: h = O.alphaOpacity,
|
|
974
|
+
side: g = O.side,
|
|
975
|
+
blendMode: l = O.blendMode,
|
|
976
|
+
blendOpacity: F = O.blendOpacity,
|
|
977
|
+
showOverlayMask: U = !1,
|
|
978
|
+
showMouthMask: X = Ae.mouth,
|
|
979
|
+
showEyeMask: A = Ae.eyes,
|
|
980
|
+
showLeftEyeMask: x,
|
|
981
|
+
showRightEyeMask: b,
|
|
982
|
+
showNoseMask: k = Ae.nose,
|
|
983
|
+
showEyeGeometry: S = !0,
|
|
984
|
+
showLeftEyeGeometry: L,
|
|
985
|
+
showRightEyeGeometry: I,
|
|
986
|
+
showMouthGeometry: _ = !0,
|
|
987
|
+
// The lips mesh is an effect-only overlay. Rendering it with the base face
|
|
988
|
+
// mesh duplicates an incomplete triangulation over the mouth.
|
|
989
|
+
showLipsGeometry: m = !1,
|
|
990
|
+
showBaseGeometry: M = !0,
|
|
991
|
+
showNoseGeometry: p = !0,
|
|
992
|
+
maskTextureSource: T = J.textureSource,
|
|
993
|
+
maskSourceUrl: j = "",
|
|
994
|
+
maskColor: ae = J.color,
|
|
995
|
+
maskOpacity: ue = J.opacity,
|
|
996
|
+
faceTextureUrl: B = "",
|
|
997
|
+
faceTextureStyle2Url: de = "",
|
|
998
|
+
faceAlphaMaskUrl: v = "",
|
|
999
|
+
compositeShading: Y = !1,
|
|
1000
|
+
transform: z,
|
|
1001
|
+
renderOrder: q = et,
|
|
1002
|
+
externalScale: me = 1,
|
|
1003
|
+
mesh: tt,
|
|
1004
|
+
meshUrl: nt,
|
|
1005
|
+
materialOverride: Z,
|
|
1006
|
+
maxUpdateFps: st,
|
|
1007
|
+
holdMs: Ie = 250,
|
|
1008
|
+
predictMs: Oe = 0
|
|
1009
|
+
}) => {
|
|
1010
|
+
const he = Wt(Xt.FACE_TRACKER), Le = $t(), { camera: rt } = Bt(), w = Sn({ mesh: tt, url: nt }), we = o(null), at = o(null), ot = o(null), it = o(null), lt = o(null), ct = o(null), ft = o(null), ut = o(null), dt = o(null), mt = o(null), ht = o(null), pt = o(null), yt = o(null), gt = o(null), bt = o(null), Et = o(null), Mt = o(null), vt = o(null), At = o(null), xt = o(null), R = $(
|
|
1011
|
+
() => w ? Ln(w) : null,
|
|
1012
|
+
[w]
|
|
1013
|
+
), De = o(null), Ne = o(-1 / 0), oe = o(null);
|
|
1014
|
+
oe.current || (oe.current = new jt({ holdMs: Ie, predictMs: Oe })), oe.current.setOptions({ holdMs: Ie, predictMs: Oe });
|
|
1015
|
+
const Tt = o(new E.Vector3()), Rt = o({ x: 0, y: 0, z: 0 }), kt = o({ x: 0, y: 0, z: 0 }), ie = o(!1), St = On[g], _t = n ?? t, Ct = Kt(), le = In(
|
|
1016
|
+
{
|
|
1017
|
+
leftEye: L ?? S,
|
|
1018
|
+
rightEye: I ?? S,
|
|
1019
|
+
leftEyeMask: U || (x ?? A),
|
|
1020
|
+
rightEyeMask: U || (b ?? A)
|
|
1021
|
+
},
|
|
1022
|
+
Ct
|
|
1023
|
+
), Ft = U || X, Ut = U || k, It = {
|
|
1024
|
+
base: we,
|
|
1025
|
+
mouth: at,
|
|
1026
|
+
lips: ot,
|
|
1027
|
+
"left-eye": it,
|
|
1028
|
+
"right-eye": lt,
|
|
1029
|
+
nose: ct,
|
|
1030
|
+
"mouth-mask": ft,
|
|
1031
|
+
"left-eye-mask": ut,
|
|
1032
|
+
"right-eye-mask": dt,
|
|
1033
|
+
"nose-mask": mt
|
|
1034
|
+
}, Ot = {
|
|
1035
|
+
base: ht,
|
|
1036
|
+
mouth: pt,
|
|
1037
|
+
lips: yt,
|
|
1038
|
+
"left-eye": gt,
|
|
1039
|
+
"right-eye": bt,
|
|
1040
|
+
nose: Et,
|
|
1041
|
+
"mouth-mask": Mt,
|
|
1042
|
+
"left-eye-mask": vt,
|
|
1043
|
+
"right-eye-mask": At,
|
|
1044
|
+
"nose-mask": xt
|
|
1045
|
+
}, Lt = {
|
|
1046
|
+
base: M,
|
|
1047
|
+
mouth: _,
|
|
1048
|
+
lips: m,
|
|
1049
|
+
"left-eye": le["left-eye"],
|
|
1050
|
+
"right-eye": le["right-eye"],
|
|
1051
|
+
nose: p,
|
|
1052
|
+
"mouth-mask": Ft,
|
|
1053
|
+
"left-eye-mask": le["left-eye-mask"],
|
|
1054
|
+
"right-eye-mask": le["right-eye-mask"],
|
|
1055
|
+
"nose-mask": Ut
|
|
1056
|
+
}, wt = (d) => /* @__PURE__ */ f(
|
|
1057
|
+
Fn,
|
|
1058
|
+
{
|
|
1059
|
+
alphaMap: u,
|
|
1060
|
+
alphaOpacity: h,
|
|
1061
|
+
blendMode: l,
|
|
1062
|
+
blendOpacity: F,
|
|
1063
|
+
cameraTexture: Le,
|
|
1064
|
+
color: _t,
|
|
1065
|
+
compositeShading: Y,
|
|
1066
|
+
faceAlphaMaskUrl: v,
|
|
1067
|
+
faceTextureStyle2Url: de,
|
|
1068
|
+
faceTextureUrl: B,
|
|
1069
|
+
masked: d,
|
|
1070
|
+
maskColor: ae,
|
|
1071
|
+
maskOpacity: ue,
|
|
1072
|
+
maskSourceUrl: j,
|
|
1073
|
+
maskTextureSource: T,
|
|
1074
|
+
materialType: a,
|
|
1075
|
+
opacity: s,
|
|
1076
|
+
shaderPreset: r,
|
|
1077
|
+
side: St,
|
|
1078
|
+
textureMap: i
|
|
1079
|
+
}
|
|
1080
|
+
), W = Un.map(
|
|
1081
|
+
(d) => ({
|
|
1082
|
+
...d,
|
|
1083
|
+
geometryRef: It[d.key],
|
|
1084
|
+
meshRef: Ot[d.key],
|
|
1085
|
+
visible: Lt[d.key]
|
|
1086
|
+
})
|
|
1087
|
+
), Dt = (d) => qt(d, rt, Tt.current);
|
|
1088
|
+
return zt((d) => {
|
|
1089
|
+
var Be, ze;
|
|
1090
|
+
const N = we.current, ee = (ze = (Be = he == null ? void 0 : he.detectionResults) == null ? void 0 : Be.faceLandmarks) == null ? void 0 : ze[e], Nt = W.every(
|
|
1091
|
+
(c) => c.geometryRef.current && c.meshRef.current
|
|
1092
|
+
);
|
|
1093
|
+
if (!w || !R || !N || !Nt) return;
|
|
1094
|
+
const P = oe.current.update(
|
|
1095
|
+
[ee ?? []],
|
|
1096
|
+
d.clock.elapsedTime * 1e3
|
|
1097
|
+
)[0];
|
|
1098
|
+
if (!P || P.length < w.vertexCount) {
|
|
1099
|
+
W.forEach((c) => {
|
|
1100
|
+
c.meshRef.current.visible = !1;
|
|
1101
|
+
});
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
if ((De.current !== w || W.some((c) => !c.geometryRef.current.index)) && (W.forEach((c) => {
|
|
1105
|
+
wn(c.geometryRef.current, R, c.getIndices(w));
|
|
1106
|
+
}), R.uv.needsUpdate = !0, R.lipEdge.needsUpdate = !0, De.current = w, ie.current = !1), Jt(d.clock.elapsedTime, Ne.current, st)) return;
|
|
1107
|
+
Ne.current = d.clock.elapsedTime;
|
|
1108
|
+
const pe = R.position.array, Pe = R.faceUv.array, ye = R.uv.array, Ge = bn(a, r, i), C = z ? kt.current : null;
|
|
1109
|
+
if (C) {
|
|
1110
|
+
C.x = 0, C.y = 0, C.z = 0;
|
|
1111
|
+
for (let c = 0; c < P.length; c++) {
|
|
1112
|
+
const D = P[c];
|
|
1113
|
+
C.x += D.x, C.y += D.y, C.z += D.z;
|
|
1114
|
+
}
|
|
1115
|
+
C.x /= P.length, C.y /= P.length, C.z /= P.length;
|
|
1116
|
+
}
|
|
1117
|
+
const Pt = Math.min(P.length, w.vertexCount);
|
|
1118
|
+
for (let c = 0; c < Pt; c++) {
|
|
1119
|
+
const D = P[c], Gt = z && C ? Yt(
|
|
1120
|
+
D,
|
|
1121
|
+
C,
|
|
1122
|
+
z,
|
|
1123
|
+
Rt.current
|
|
1124
|
+
) : D, ge = c * 3, ce = c * 2, be = Dt(Gt);
|
|
1125
|
+
pe[ge] = be.x, pe[ge + 1] = be.y, pe[ge + 2] = be.z, Pe[ce] = D.x, Pe[ce + 1] = 1 - D.y, Ge && (ye[ce] = D.x, ye[ce + 1] = 1 - D.y);
|
|
1126
|
+
}
|
|
1127
|
+
Ge ? (N.attributes.uv.needsUpdate = !0, ie.current = !0) : ie.current && (ye.set(w.uvs), N.attributes.uv.needsUpdate = !0, ie.current = !1), W.forEach((c) => {
|
|
1128
|
+
c.meshRef.current.visible = c.visible;
|
|
1129
|
+
}), N.attributes.position.needsUpdate = !0, N.attributes.faceUv.needsUpdate = !0, W.forEach((c) => {
|
|
1130
|
+
c.geometryRef.current.computeVertexNormals();
|
|
1131
|
+
});
|
|
1132
|
+
}), /* @__PURE__ */ f("group", { scale: [me, me, me], children: W.map((d) => {
|
|
1133
|
+
const N = Z ? typeof Z == "function" ? Z({
|
|
1134
|
+
cameraTexture: Le ?? null,
|
|
1135
|
+
geometryKey: d.key,
|
|
1136
|
+
faceUv: (R == null ? void 0 : R.faceUv) ?? null,
|
|
1137
|
+
lipEdge: (R == null ? void 0 : R.lipEdge) ?? null
|
|
1138
|
+
}) : Z : void 0, ee = N instanceof E.Material ? N : void 0;
|
|
1139
|
+
return /* @__PURE__ */ Fe(
|
|
1140
|
+
"mesh",
|
|
1141
|
+
{
|
|
1142
|
+
ref: d.meshRef,
|
|
1143
|
+
renderOrder: q + d.renderOrderOffset,
|
|
1144
|
+
frustumCulled: !1,
|
|
1145
|
+
material: ee,
|
|
1146
|
+
children: [
|
|
1147
|
+
/* @__PURE__ */ f("bufferGeometry", { ref: d.geometryRef }),
|
|
1148
|
+
ee ? null : Z ? N : wt(d.masked)
|
|
1149
|
+
]
|
|
1150
|
+
},
|
|
1151
|
+
`${d.key}:${ee ? "instance" : "node"}`
|
|
1152
|
+
);
|
|
1153
|
+
}) });
|
|
1154
|
+
}, Nn = `${se.sdkAssetsBaseUrl}/Canonical_Face_Color.png`, Pn = `${se.sdkAssetsBaseUrl}/Canonical_Face_Color_style_2.png`, Gn = `${se.sdkAssetsBaseUrl}/Canonical_Face_Color_Mask.png`, Bn = {
|
|
1155
|
+
...Xe,
|
|
1156
|
+
position: { ...Xe.position, y: 1e-3 }
|
|
1157
|
+
}, as = {
|
|
1158
|
+
enabled: !0,
|
|
1159
|
+
faceIndex: 0,
|
|
1160
|
+
targetFps: gn,
|
|
1161
|
+
...O,
|
|
1162
|
+
showLeftEyeGeometry: !0,
|
|
1163
|
+
showRightEyeGeometry: !0,
|
|
1164
|
+
showMouthGeometry: !0,
|
|
1165
|
+
showNoseGeometry: !0,
|
|
1166
|
+
externalScale: 1,
|
|
1167
|
+
showOverlayMask: !1,
|
|
1168
|
+
showMouthMask: !1,
|
|
1169
|
+
showLeftEyeMask: !1,
|
|
1170
|
+
showRightEyeMask: !1,
|
|
1171
|
+
showNoseMask: !1,
|
|
1172
|
+
maskTextureSource: J.textureSource,
|
|
1173
|
+
maskSourceUrl: "",
|
|
1174
|
+
maskColor: J.color,
|
|
1175
|
+
maskOpacity: J.opacity,
|
|
1176
|
+
faceTextureUrl: Nn,
|
|
1177
|
+
faceTextureStyle2Url: Pn,
|
|
1178
|
+
faceAlphaMaskUrl: Gn,
|
|
1179
|
+
renderOrder: et
|
|
1180
|
+
}, zn = (e) => {
|
|
1181
|
+
const { externalMeshUrl: n, ...t } = e;
|
|
1182
|
+
return { ...t, color: t.baseColor, meshUrl: n };
|
|
1183
|
+
}, Hn = ({
|
|
1184
|
+
materialOverride: e,
|
|
1185
|
+
value: n
|
|
1186
|
+
}) => ({
|
|
1187
|
+
...zn(n),
|
|
1188
|
+
materialOverride: e
|
|
1189
|
+
}), os = (e, n) => {
|
|
1190
|
+
const t = { ...e, ...n };
|
|
1191
|
+
return n.maskTextureSource && !Ce(n.maskTextureSource) && (t.maskSourceUrl = ""), t.materialType === y.shader && n.shaderPreset === H.composite ? {
|
|
1192
|
+
...t,
|
|
1193
|
+
...je,
|
|
1194
|
+
materialType: y.shader,
|
|
1195
|
+
shaderPreset: H.composite
|
|
1196
|
+
} : t.materialType === y.shader && t.shaderPreset === H.composite && t.textureMap === V.none ? {
|
|
1197
|
+
...t,
|
|
1198
|
+
textureMap: je.textureMap
|
|
1199
|
+
} : t;
|
|
1200
|
+
}, is = ({ transform: e, value: n, materialOverride: t }) => n.enabled ? /* @__PURE__ */ Fe(Ye, { children: [
|
|
1201
|
+
/* @__PURE__ */ f(
|
|
1202
|
+
Qt,
|
|
1203
|
+
{
|
|
1204
|
+
active: n.enabled,
|
|
1205
|
+
faceIndex: n.faceIndex,
|
|
1206
|
+
numFaces: n.faceIndex + 1,
|
|
1207
|
+
targetFps: n.targetFps
|
|
1208
|
+
}
|
|
1209
|
+
),
|
|
1210
|
+
/* @__PURE__ */ f(
|
|
1211
|
+
Dn,
|
|
1212
|
+
{
|
|
1213
|
+
...Hn({ value: n, materialOverride: t }),
|
|
1214
|
+
transform: e ?? Bn
|
|
1215
|
+
}
|
|
1216
|
+
)
|
|
1217
|
+
] }) : null, Vn = 30, ls = 31, cs = (e, n = 1) => {
|
|
1218
|
+
const t = n + e;
|
|
1219
|
+
if (t < 1 || t > Vn)
|
|
1220
|
+
throw new RangeError(`Render-group layer ${t} is outside the supported range 1-30.`);
|
|
1221
|
+
return t;
|
|
1222
|
+
}, te = /* @__PURE__ */ new WeakMap(), fs = (e) => te.get(e) ?? null, us = ({
|
|
1223
|
+
renderer: e,
|
|
1224
|
+
scene: n,
|
|
1225
|
+
camera: t,
|
|
1226
|
+
layers: s,
|
|
1227
|
+
includeDefaultLayer: a = !0
|
|
1228
|
+
}) => {
|
|
1229
|
+
const r = t.layers.mask, i = e.autoClear, u = te.get(e);
|
|
1230
|
+
try {
|
|
1231
|
+
if (e.autoClear = !1, e.clear(!0, !0, !0), s.length === 0) {
|
|
1232
|
+
t.layers.set(0), e.render(n, t);
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
const h = { index: 0, count: s.length };
|
|
1236
|
+
te.set(e, h), s.forEach((g, l) => {
|
|
1237
|
+
h.index = l, t.layers.set(g), a && g !== 0 && t.layers.enable(0), l > 0 && e.clearDepth(), e.render(n, t);
|
|
1238
|
+
});
|
|
1239
|
+
} finally {
|
|
1240
|
+
u ? te.set(e, u) : te.delete(e), t.layers.mask = r, e.autoClear = i;
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
export {
|
|
1244
|
+
Bn as A,
|
|
1245
|
+
Ae as B,
|
|
1246
|
+
$e as C,
|
|
1247
|
+
K as D,
|
|
1248
|
+
ls as E,
|
|
1249
|
+
y as F,
|
|
1250
|
+
Dn as G,
|
|
1251
|
+
Fn as H,
|
|
1252
|
+
Gn as I,
|
|
1253
|
+
Pn as J,
|
|
1254
|
+
Nn as K,
|
|
1255
|
+
Un as L,
|
|
1256
|
+
Vn as M,
|
|
1257
|
+
In as N,
|
|
1258
|
+
Hn as O,
|
|
1259
|
+
zn as P,
|
|
1260
|
+
Sn as Q,
|
|
1261
|
+
xn as R,
|
|
1262
|
+
dn as S,
|
|
1263
|
+
ns as T,
|
|
1264
|
+
H as a,
|
|
1265
|
+
ne as b,
|
|
1266
|
+
V as c,
|
|
1267
|
+
Q as d,
|
|
1268
|
+
Ze as e,
|
|
1269
|
+
re as f,
|
|
1270
|
+
cs as g,
|
|
1271
|
+
pn as h,
|
|
1272
|
+
as as i,
|
|
1273
|
+
Xe as j,
|
|
1274
|
+
ts as k,
|
|
1275
|
+
Je as l,
|
|
1276
|
+
is as m,
|
|
1277
|
+
ln as n,
|
|
1278
|
+
_e as o,
|
|
1279
|
+
rs as p,
|
|
1280
|
+
En as q,
|
|
1281
|
+
us as r,
|
|
1282
|
+
ss as s,
|
|
1283
|
+
Ce as t,
|
|
1284
|
+
an as u,
|
|
1285
|
+
os as v,
|
|
1286
|
+
We as w,
|
|
1287
|
+
fs as x,
|
|
1288
|
+
Ke as y,
|
|
1289
|
+
O as z
|
|
1290
|
+
};
|