@vincentt-xr/sdk 2.0.0-alpha.8 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GROUNDING.md +4643 -170
- 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/gltfLoader.d.ts +16 -0
- package/dist/assets/loaders.d.ts +16 -1
- 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 +11 -6
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -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 +10 -2
- 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 +5 -3
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +9 -0
- package/dist/components/FaceMesh/index.d.ts +1 -1
- 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/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/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/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/LipEffect/LipEffect.d.ts +22 -2
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +62 -10
- package/dist/components/LipEffect/LipEffects.d.ts +5 -2
- package/dist/components/LipEffect/defaults.d.ts +21 -2
- package/dist/components/LipEffect/index.d.ts +1 -1
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +117 -13
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +82 -10
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +6 -0
- package/dist/components/LipEffect/uvGuide.d.ts +31 -16
- 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/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/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/config/index.d.ts +0 -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/index.d.ts +2 -0
- package/dist/coordinates/side.d.ts +40 -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/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/index.d.ts +4 -3
- 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 +3 -2
- 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/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 +3 -2
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2250 -2472
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +3 -2
- package/dist/entries/face-effects.d.ts +114 -8
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +28 -1
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/tracking.d.ts +37 -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 +2252 -83
- package/dist/face-effects.js +14234 -1231
- 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 +15 -2
- package/dist/gestures/index.d.ts +1 -1
- package/dist/gestures/measures.d.ts +21 -8
- 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 +8 -0
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- 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/{renderPasses-NnKZVfBy.js → index-w1S7fI2B.js} +219 -247
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-vsfNQycj.js → internal-B90P-clC.js} +138 -118
- 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 +7 -5
- package/dist/iris/types.d.ts +6 -4
- package/dist/{landmarkMask-CbTFzBYG.js → landmarkMask-BFDyBnKM.js} +6 -6
- 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 +666 -602
- package/dist/main.cjs +1 -1
- package/dist/main.js +866 -1182
- package/dist/models/Body/index.d.ts +2 -0
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +3 -11
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Segmentation/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.cjs +1 -1
- package/dist/product.js +29 -29
- package/dist/{providers-C0Dlhh9Z.js → providers-C8rE26Uf.js} +127 -126
- package/dist/providers-DHsrhDI2.cjs +62 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-CN1cGFUo.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-O4KmaMl9.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/types.d.ts +6 -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-aQk845NJ.js → settings-BJ7FMBsO.js} +53 -15
- 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/tracking.cjs +10 -1
- package/dist/tracking.js +1002 -855
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- package/dist/types/nodes.d.ts +20 -1
- package/dist/types/segmentation.d.ts +5 -0
- 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-B1R2ghy-.cjs → useXRCapabilities-Cr3RzuAW.cjs} +1 -1
- package/dist/{useXRCapabilities-C68v__wB.js → useXRCapabilities-Cxmlmpbd.js} +1 -1
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +17 -0
- 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/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-CsUdQ-pn.js → uv-DJU_XfmN.js} +15 -249
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +1 -1
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +1 -1
- package/docs/api/coordinate-spaces.mdx +7 -4
- package/docs/api/cross-camera.mdx +3 -2
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- 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 +3 -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 +4 -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 +68 -32
- 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 +6 -1
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +24 -19
- 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 +4 -1
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +1 -1
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +5 -2
- package/docs/api/segmentation-overlay.mdx +1 -1
- package/docs/docs.json +29 -1
- package/docs/examples/lip-shaders.mdx +82 -33
- 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 +178 -102
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -1
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/package.json +11 -1
- package/dist/DebuggerUI-C-ldiozL.js +0 -269
- package/dist/DebuggerUI-CWX5EtQv.cjs +0 -1
- package/dist/FaceMeshRenderer-BEEXZwS6.cjs +0 -158
- package/dist/FaceMeshRenderer-UuH5sTXG.js +0 -1322
- package/dist/FaceRetouch-C7h7x9kd.js +0 -683
- package/dist/FaceRetouch-DqftT26Y.cjs +0 -134
- package/dist/GLTFLoader-C5q63sKO.js +0 -1633
- package/dist/GLTFLoader-Cb_CRwmG.cjs +0 -1
- package/dist/SegmentationOverlay-DQuW3dsc.js +0 -133
- package/dist/SegmentationOverlay-aWVod8Kl.cjs +0 -1
- 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-CO0sd4JQ.cjs +0 -1
- package/dist/contexts-FzlnnMYD.js +0 -669
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-BkZfaQs-.js +0 -118
- package/dist/getFaceInfo-ahPxQFGu.cjs +0 -1
- package/dist/index--RgGzZ6X.cjs +0 -47
- package/dist/index-CHVbH0hz.js +0 -214
- package/dist/index-CeVkgsag.cjs +0 -1
- package/dist/index-CnGox6Xr.js +0 -3054
- package/dist/index-DKBAh6hV.cjs +0 -1
- package/dist/index-DsZwTfG0.cjs +0 -1
- package/dist/index-Dw6tj2Mi.js +0 -144
- package/dist/index-OCPjOaeP.cjs +0 -1
- package/dist/index-s9pF4zkG.js +0 -2053
- package/dist/internal-BYza1h8_.cjs +0 -1
- package/dist/measures-9dQPdw96.js +0 -154
- package/dist/measures-KfJzpvod.cjs +0 -1
- package/dist/providers-YNwkmNeK.cjs +0 -62
- package/dist/renderPasses-Cg-zqmEz.cjs +0 -21
- package/dist/screenTransform-BenfCtZt.js +0 -44
- package/dist/screenTransform-BiXdpVf0.cjs +0 -1
- package/dist/segmentation-9PhSvc-R.cjs +0 -1
- package/dist/segmentation-CeOTKemr.js +0 -5
- package/dist/selectors-C5G1PMYL.js +0 -195
- package/dist/selectors-Du_PsVnW.cjs +0 -1
- package/dist/session-BBr0yN8h.cjs +0 -31
- package/dist/session-Cy0m7l7-.js +0 -363
- package/dist/settings-DRR7-snV.cjs +0 -1
- package/dist/useFaceInfo-Blf7FCu3.js +0 -303
- package/dist/useFaceInfo-C5mO8NQY.cjs +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A landmark polyline on the face, in the canonical head frame (cm, +X toward
|
|
3
|
+
* landmark 263, +Y up, +Z out of the face).
|
|
4
|
+
*/
|
|
5
|
+
export type FaceAtlasPolyline = {
|
|
6
|
+
/** Landmark indices along the line. */
|
|
7
|
+
readonly landmarks: readonly number[];
|
|
8
|
+
/** `[x, y, z, …]` rest positions of `landmarks`, cm. */
|
|
9
|
+
readonly points: Float32Array;
|
|
10
|
+
/** The last point connects back to the first. */
|
|
11
|
+
readonly closed: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Authored on the canonical −X side (landmark 33's eye and brow); the +X
|
|
14
|
+
* twin is `mirrorFaceAtlasPolyline(polyline)` or `(−x, y, z)`. Which side is
|
|
15
|
+
* the person's own left depends on the feed: `personLeftSign(mirrored)`.
|
|
16
|
+
*/
|
|
17
|
+
readonly sided: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const FACE_ATLAS_POLYLINE_NAMES: readonly ["upperLash", "lowerLash", "browUpper", "browLower", "lipOuter", "lipInner", "oval", "noseBridge"];
|
|
20
|
+
export type FaceAtlasPolylineName = (typeof FACE_ATLAS_POLYLINE_NAMES)[number];
|
|
21
|
+
/**
|
|
22
|
+
* Feature lines for analytic masks (distance fields on the rest position).
|
|
23
|
+
* Lash lines run from the outer eye corner (33) to the inner corner (133);
|
|
24
|
+
* brow edges run from the tail (outer) to the head (inner). Each line is
|
|
25
|
+
* built on first read and shared (do not mutate).
|
|
26
|
+
*/
|
|
27
|
+
export declare const FACE_ATLAS_POLYLINES: Readonly<Record<FaceAtlasPolylineName, FaceAtlasPolyline>>;
|
|
28
|
+
/**
|
|
29
|
+
* Named anchor landmarks for placing shapes (blush, contour, highlight),
|
|
30
|
+
* sided ones on the canonical −X side like the sided polylines. Read the
|
|
31
|
+
* position with `faceAtlasAnchorPosition(name)`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const FACE_ATLAS_ANCHORS: {
|
|
34
|
+
readonly outerEyeCorner: 33;
|
|
35
|
+
readonly innerEyeCorner: 133;
|
|
36
|
+
readonly browTail: 70;
|
|
37
|
+
readonly browPeak: 105;
|
|
38
|
+
readonly browHead: 107;
|
|
39
|
+
readonly temple: 139;
|
|
40
|
+
readonly cheekbone: 116;
|
|
41
|
+
readonly cheekApple: 205;
|
|
42
|
+
readonly cheekHollow: 187;
|
|
43
|
+
readonly mouthCorner: 61;
|
|
44
|
+
readonly jawAngle: 172;
|
|
45
|
+
readonly noseBridge: 6;
|
|
46
|
+
readonly noseTip: 4;
|
|
47
|
+
readonly cupidsBow: 0;
|
|
48
|
+
readonly chin: 199;
|
|
49
|
+
readonly foreheadCenter: 151;
|
|
50
|
+
};
|
|
51
|
+
export type FaceAtlasAnchorName = keyof typeof FACE_ATLAS_ANCHORS;
|
|
52
|
+
/** Rest position (cm) of an anchor, on the canonical −X side or mirrored to +X. */
|
|
53
|
+
export declare const faceAtlasAnchorPosition: (name: FaceAtlasAnchorName, side?: "negX" | "posX") => [number, number, number];
|
|
54
|
+
/** The +X twin of a sided polyline (landmarks through `FACE_ATLAS_MIRROR`, x negated). */
|
|
55
|
+
export declare const mirrorFaceAtlasPolyline: (line: FaceAtlasPolyline) => FaceAtlasPolyline;
|
|
56
|
+
/**
|
|
57
|
+
* GLSL ES 3.00 constants for polylines: for each name
|
|
58
|
+
* `const int <PREFIX><NAME>_COUNT = n;` and
|
|
59
|
+
* `const vec3 <PREFIX><NAME>[n] = vec3[n](…);` (cm, rest positions), e.g.
|
|
60
|
+
* `FACE_ATLAS_UPPER_LASH`. Sided lines are the −X instance; fold `x` to
|
|
61
|
+
* `−abs(x)` (or mirror) in the shader for the other side.
|
|
62
|
+
*/
|
|
63
|
+
export declare const createFaceAtlasPolylineGlsl: (names?: readonly FaceAtlasPolylineName[], prefix?: string) => string;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { FaceImageLandmark } from '../../face-character/faceReprojection';
|
|
2
|
+
import { FaceSkinProbeGate } from './constants';
|
|
3
|
+
import { FaceSkinStats } from './stats';
|
|
4
|
+
import { FaceSkinProbeFormat, FaceSkinStatsFormat } from './targets';
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
export type FaceSkinProbeOptions = {
|
|
7
|
+
/** Skin map size, texels per side. Default 128 (64 on the low quality tier). */
|
|
8
|
+
resolution?: 64 | 128;
|
|
9
|
+
/**
|
|
10
|
+
* Render targets: `true` RGBA16F, `false` the RGBA8 fallback (no temporal
|
|
11
|
+
* averaging of the maps), `"auto"` (default) RGBA16F when the renderer can
|
|
12
|
+
* render to it. Without `renderer`, the formats are settled on the first
|
|
13
|
+
* `render`.
|
|
14
|
+
*/
|
|
15
|
+
halfFloat?: boolean | "auto";
|
|
16
|
+
/** Settles the formats at once. */
|
|
17
|
+
renderer?: THREE.WebGLRenderer;
|
|
18
|
+
};
|
|
19
|
+
export type FaceSkinProbeRenderOptions = {
|
|
20
|
+
/** Seconds since the last update (clamped to `FACE_SKIN_PROBE.maxDt`). Default 1 / 15. */
|
|
21
|
+
dt?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Restart every average. The probe also restarts by itself on its first
|
|
24
|
+
* update and when the texture object changes.
|
|
25
|
+
*/
|
|
26
|
+
snap?: boolean;
|
|
27
|
+
/** 0..1, how present the face is (a fading track); under 0.5 the probe freezes. Default 1. */
|
|
28
|
+
presence?: number;
|
|
29
|
+
/** Apply the freeze rule (turned, small, absent). Default true. */
|
|
30
|
+
gate?: boolean;
|
|
31
|
+
/** Fit the light direction (off: zero gradient, shading uses the key light). Default true. */
|
|
32
|
+
lightFit?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The image's pixel size, when the texture's `image` does not tell (a
|
|
35
|
+
* render target's texture, a data texture).
|
|
36
|
+
*/
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The direction from the camera to the face in the camera's view space
|
|
41
|
+
* (x right, y up, the camera looking down −Z), any length: for example
|
|
42
|
+
* landmark 1 unprojected through the render camera. The landmarks show the
|
|
43
|
+
* head's turn against its own line of sight; this turns the fitted light
|
|
44
|
+
* into the camera's view frame, where the rendered face's normals are.
|
|
45
|
+
* Omitted: the optical axis, so the light is in the face's line-of-sight
|
|
46
|
+
* frame (exact at the image centre; a face 15° off axis reads its light
|
|
47
|
+
* about 15° turned). `useFaceSkin` passes it.
|
|
48
|
+
*/
|
|
49
|
+
lineOfSight?: THREE.Vector3Like;
|
|
50
|
+
};
|
|
51
|
+
/** What one `render` did: `"updated"`, or why it froze. */
|
|
52
|
+
export type FaceSkinProbeResult = "updated" | Exclude<FaceSkinProbeGate, null> | "no-landmarks";
|
|
53
|
+
/**
|
|
54
|
+
* The person's own skin, light and lip and brow colours, measured from any
|
|
55
|
+
* texture plus its face landmarks: the live camera, a photo or a video frame
|
|
56
|
+
* (FACE-1 makeup, face swap, faceless). No readback: everything stays on the
|
|
57
|
+
* GPU, for shaders.
|
|
58
|
+
*
|
|
59
|
+
* Each `render`:
|
|
60
|
+
* 1. **Unwrap** (one MRT draw of the atlas `face` region): every atlas texel
|
|
61
|
+
* takes the image under its landmark triangle, premultiplied by a weight
|
|
62
|
+
* (how squarely it faces the camera, from the landmarks alone, × in frame).
|
|
63
|
+
* `skinMap` also multiplies by the static skin mask (no eyes, brows, lips
|
|
64
|
+
* or nostrils); `featureMap` keeps everything. Both average over time
|
|
65
|
+
* (ConstantAlpha EMA, τ 0.25 s) and are mipmapped, so `rgb / a` at any mip
|
|
66
|
+
* is a normalised local average that fills the features from the skin
|
|
67
|
+
* around them.
|
|
68
|
+
* 2. **Stats** (8 × 1, `lightingMap`, ping-pong): slow and fast global skin,
|
|
69
|
+
* the light fitted over 16 skin taps (view space), and the lip and brow
|
|
70
|
+
* colours (`FACE_SKIN_STATS`).
|
|
71
|
+
*
|
|
72
|
+
* Updates freeze while the head is turned more than 35°, the face is under
|
|
73
|
+
* 80 px, or `presence` is under 0.5, and every average restarts on the first
|
|
74
|
+
* update, a new texture, `snap`, or a skin luminance jump over 40 %.
|
|
75
|
+
*/
|
|
76
|
+
export declare class FaceSkinProbe {
|
|
77
|
+
/** The skin map, the feature map (MRT). */
|
|
78
|
+
private mapTarget;
|
|
79
|
+
/** Maps at a new size (`setResolution`), bound by the next update. */
|
|
80
|
+
private pendingMapTarget;
|
|
81
|
+
/** The stats ping-pong: `stats[current]` holds the latest. */
|
|
82
|
+
private stats;
|
|
83
|
+
private current;
|
|
84
|
+
private formatResolved;
|
|
85
|
+
private formatValue;
|
|
86
|
+
private statsFormatValue;
|
|
87
|
+
/** The bound maps' size. */
|
|
88
|
+
private size;
|
|
89
|
+
private readonly halfFloat;
|
|
90
|
+
private readonly mask;
|
|
91
|
+
private readonly camera;
|
|
92
|
+
private readonly unwrapScene;
|
|
93
|
+
private readonly statsScene;
|
|
94
|
+
private readonly unwrapGeometry;
|
|
95
|
+
private readonly statsGeometry;
|
|
96
|
+
private readonly unwrapMaterial;
|
|
97
|
+
private readonly statsMaterial;
|
|
98
|
+
private readonly pose;
|
|
99
|
+
private readonly step;
|
|
100
|
+
private readonly stepInput;
|
|
101
|
+
private readonly imageSize;
|
|
102
|
+
private readonly gateInput;
|
|
103
|
+
private readonly unwrapImage;
|
|
104
|
+
private readback;
|
|
105
|
+
/** `readStatsAsync`'s byte buffer (made on its first read). */
|
|
106
|
+
private readbackBytes;
|
|
107
|
+
/** The read in flight, shared by every `readStatsAsync` call until it settles. */
|
|
108
|
+
private pendingRead;
|
|
109
|
+
private disposed;
|
|
110
|
+
private lastTexture;
|
|
111
|
+
private pendingSnap;
|
|
112
|
+
private updates;
|
|
113
|
+
private readonly unwrapUniforms;
|
|
114
|
+
private readonly statsUniforms;
|
|
115
|
+
/**
|
|
116
|
+
* Uniforms for shaders that read the probe, kept current (spread them into
|
|
117
|
+
* a material's `uniforms`; the objects are shared, so the material follows
|
|
118
|
+
* size and format changes): `uSkinMap`, `uSkinLod`, `uSkinSqrt` (as
|
|
119
|
+
* `MAKEUP_GLSL.common` reads them) and `uSkinStats`, `uSkinStatsPacked`
|
|
120
|
+
* (as `FACE_SKIN_STATS_GLSL` reads them).
|
|
121
|
+
*/
|
|
122
|
+
readonly uniforms: {
|
|
123
|
+
uSkinMap: {
|
|
124
|
+
value: THREE.Texture | null;
|
|
125
|
+
};
|
|
126
|
+
uSkinLod: {
|
|
127
|
+
value: number;
|
|
128
|
+
};
|
|
129
|
+
uSkinSqrt: {
|
|
130
|
+
value: number;
|
|
131
|
+
};
|
|
132
|
+
uSkinStats: {
|
|
133
|
+
value: THREE.Texture | null;
|
|
134
|
+
};
|
|
135
|
+
uSkinStatsPacked: {
|
|
136
|
+
value: number;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
constructor(options?: FaceSkinProbeOptions);
|
|
140
|
+
/** The skin map: atlas space, premultiplied linear skin `(c·w, w)`, mipmapped. */
|
|
141
|
+
get skinMap(): THREE.Texture;
|
|
142
|
+
/** Every unwrapped texel (lips and brows too) weighted by facing, same encoding. */
|
|
143
|
+
get featureMap(): THREE.Texture;
|
|
144
|
+
/** The stats (`FACE_SKIN_STATS`), read with `FACE_SKIN_STATS_GLSL`. */
|
|
145
|
+
get lightingMap(): THREE.Texture;
|
|
146
|
+
/** The maps: `"half-float"` or the `"rgba8"` fallback. */
|
|
147
|
+
get format(): FaceSkinProbeFormat;
|
|
148
|
+
/** The stats: `"float"` (RGBA32F) or `"packed"` (RGBA8, `uSkinStatsPacked` = 1). */
|
|
149
|
+
get statsFormat(): FaceSkinStatsFormat;
|
|
150
|
+
/** Skin map size, texels per side, of the next update (`setResolution`). */
|
|
151
|
+
get resolution(): number;
|
|
152
|
+
/** Updates since the last restart (0: no data yet). */
|
|
153
|
+
get updateCount(): number;
|
|
154
|
+
/**
|
|
155
|
+
* The head pose of the last update (rotation canonical → the face's line
|
|
156
|
+
* of sight, yaw, pitch, face height).
|
|
157
|
+
*/
|
|
158
|
+
get lastPose(): import('./unwrap').FaceSkinPose;
|
|
159
|
+
/**
|
|
160
|
+
* Changes the skin map size. Only the maps start over: the next update
|
|
161
|
+
* renders into new maps and binds them (until then shaders keep the old
|
|
162
|
+
* ones); the stats and `ready` carry on.
|
|
163
|
+
*/
|
|
164
|
+
setResolution(resolution: 64 | 128): void;
|
|
165
|
+
/** Forget everything: the next update restarts every average (not ready until it has data). */
|
|
166
|
+
reset(): void;
|
|
167
|
+
/**
|
|
168
|
+
* One update from `texture` (any image: the session camera, a photo, a
|
|
169
|
+
* video frame) and that image's face landmarks (≥ 468, normalized image
|
|
170
|
+
* coordinates, y down, z in x units, as the face tracker and
|
|
171
|
+
* `detectFaceImage` report them). Leaves the renderer's target, clear
|
|
172
|
+
* colour and XR state as they were.
|
|
173
|
+
*/
|
|
174
|
+
render(renderer: THREE.WebGLRenderer, texture: THREE.Texture, landmarks: ArrayLike<FaceImageLandmark>, options?: FaceSkinProbeRenderOptions): FaceSkinProbeResult;
|
|
175
|
+
/**
|
|
176
|
+
* One update from a still image (a photo): no freeze rule, every average
|
|
177
|
+
* replaced, ready at once. Call it once per image.
|
|
178
|
+
*/
|
|
179
|
+
renderStill(renderer: THREE.WebGLRenderer, texture: THREE.Texture, landmarks: ArrayLike<FaceImageLandmark>, options?: Pick<FaceSkinProbeRenderOptions, "lightFit" | "width" | "height" | "lineOfSight">): FaceSkinProbeResult;
|
|
180
|
+
private update;
|
|
181
|
+
/**
|
|
182
|
+
* Reads the stats back to the CPU, decoded. A synchronous GPU readback:
|
|
183
|
+
* for debug panels and tests, not per frame.
|
|
184
|
+
*/
|
|
185
|
+
readStats(renderer: THREE.WebGLRenderer): FaceSkinStats;
|
|
186
|
+
/**
|
|
187
|
+
* Reads the stats back without stalling the GPU: the stats are packed into
|
|
188
|
+
* bytes now (one 24 × 1 draw) and copied to the CPU once the GPU is done
|
|
189
|
+
* (`readRenderTargetPixelsAsync`; a renderer without it reads at once).
|
|
190
|
+
* Resolves to `out` (`FACE_SKIN_STATS.texels × 4` floats in the
|
|
191
|
+
* `FACE_SKIN_STATS` layout, read them with `readFaceSkinStats`), or `null`
|
|
192
|
+
* when the probe was disposed or the read failed. A call while a read is in
|
|
193
|
+
* flight (another reader of the same face) shares that read. For a few
|
|
194
|
+
* reads a second at most (`useMakeupSkinTone` reads twice a second), never
|
|
195
|
+
* per frame.
|
|
196
|
+
*/
|
|
197
|
+
readStatsAsync(renderer: THREE.WebGLRenderer, out?: Float32Array): Promise<Float32Array | null>;
|
|
198
|
+
/** One readback into a fresh array (the in-flight read `readStatsAsync` shares). */
|
|
199
|
+
private readStatsOnce;
|
|
200
|
+
/** Packs the current stats into the RGBA8 readback target (float readPixels is not portable). */
|
|
201
|
+
private packStats;
|
|
202
|
+
dispose(): void;
|
|
203
|
+
/** The image's pixel size: the options, else the texture's image (written into a scratch object). */
|
|
204
|
+
private readImageSize;
|
|
205
|
+
private createReadback;
|
|
206
|
+
private resolveFormat;
|
|
207
|
+
private syncUniforms;
|
|
208
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FaceSkinSelfTestImage } from '../selfTest';
|
|
2
|
+
import { FaceSkinStatsInput } from '../stats';
|
|
3
|
+
/** The stats pass's input for one self-test image, measured on the CPU. */
|
|
4
|
+
export declare const emulateFaceSkinStatsInput: (image: FaceSkinSelfTestImage, size?: number) => FaceSkinStatsInput;
|
|
5
|
+
/**
|
|
6
|
+
* `a` blended toward `b` by `t` (the half-float maps' ConstantAlpha EMA: every
|
|
7
|
+
* stats input is linear in the map texels).
|
|
8
|
+
*/
|
|
9
|
+
export declare const mixFaceSkinStatsInput: (a: FaceSkinStatsInput, b: FaceSkinStatsInput, t: number) => FaceSkinStatsInput;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FaceImageLandmark } from '../../../face-character/faceReprojection';
|
|
2
|
+
/**
|
|
3
|
+
* Test landmarks: the canonical face turned by `yawDeg` (toward canonical +X
|
|
4
|
+
* for positive values) and `pitchDeg` (chin down for positive values), drawn
|
|
5
|
+
* orthographically into a `width` × `height` image at `pxPerCm`, the way
|
|
6
|
+
* MediaPipe reports a face (normalized, y down, z in x units, smaller toward
|
|
7
|
+
* the camera). Also returns the canonical → view rotation (column-major).
|
|
8
|
+
*/
|
|
9
|
+
export declare const makeTestFace: ({ yawDeg, pitchDeg, width, height, pxPerCm, centerX, centerY, mirrorImage, }?: {
|
|
10
|
+
yawDeg?: number;
|
|
11
|
+
pitchDeg?: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
pxPerCm?: number;
|
|
15
|
+
centerX?: number;
|
|
16
|
+
centerY?: number;
|
|
17
|
+
/** Flip the image left-right after drawing (a mirrored feed). */
|
|
18
|
+
mirrorImage?: boolean;
|
|
19
|
+
}) => {
|
|
20
|
+
landmarks: FaceImageLandmark[];
|
|
21
|
+
rotation: number[];
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skin probe's tuning (FACE-1 #274): what the unwrap keeps, when the
|
|
3
|
+
* probe freezes, how its averages move. Times are seconds, angles degrees.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FACE_SKIN_PROBE: Readonly<{
|
|
6
|
+
/**
|
|
7
|
+
* How squarely a patch of skin must face the camera to count, as the cosine
|
|
8
|
+
* of its turn (landmark triangle area on the image over its 3D area): not
|
|
9
|
+
* at all below `facingMin` (seen edge-on, its pixels smeared), fully above
|
|
10
|
+
* `facingFull`.
|
|
11
|
+
*/
|
|
12
|
+
readonly facingMin: 0.1;
|
|
13
|
+
readonly facingFull: 0.5;
|
|
14
|
+
/** Landmarks within this fraction of the image edge fade out (the image is clamped there). */
|
|
15
|
+
readonly inFrameMargin: 0.01;
|
|
16
|
+
/** Size (texels per side) of the static skin mask. */
|
|
17
|
+
readonly maskSize: 128;
|
|
18
|
+
/**
|
|
19
|
+
* The skin mask's edge fade, as a fraction of the atlas width. The unwrap
|
|
20
|
+
* keeps the mask's inner half (`smoothstep(0.5, 1, mask)`), so the oval,
|
|
21
|
+
* the lips, the brows, the eyes and the nostrils are cut back by about half
|
|
22
|
+
* of this, away from landmark error.
|
|
23
|
+
*/
|
|
24
|
+
readonly maskFeather: 0.03;
|
|
25
|
+
/** Updates freeze while the head is turned (yaw) more than this. */
|
|
26
|
+
readonly maxYawDeg: 35;
|
|
27
|
+
/** Updates freeze while the face (landmark 10 to 152 on the image) is shorter than this, px. */
|
|
28
|
+
readonly minFacePx: 80;
|
|
29
|
+
/** Updates freeze while the face's presence is below this. */
|
|
30
|
+
readonly minPresence: 0.5;
|
|
31
|
+
/**
|
|
32
|
+
* The longest time one update averages over: a frozen probe does not age,
|
|
33
|
+
* so the first update after a freeze moves the averages as one normal step.
|
|
34
|
+
*/
|
|
35
|
+
readonly maxDt: 0.25;
|
|
36
|
+
/** `Rf`, the skin map's temporal average (ConstantAlpha EMA). */
|
|
37
|
+
readonly fastTau: 0.25;
|
|
38
|
+
/** `Rs` and the person's lip and brow colours. */
|
|
39
|
+
readonly slowTau: 4;
|
|
40
|
+
/** The fitted light (view space). */
|
|
41
|
+
readonly lightTau: 0.5;
|
|
42
|
+
/**
|
|
43
|
+
* When the fast skin's luminance differs from the slow skin's by more than
|
|
44
|
+
* this fraction (a lamp switched, a new person), every slow average snaps
|
|
45
|
+
* to the current value instead of drifting for seconds.
|
|
46
|
+
*/
|
|
47
|
+
readonly snapJump: 0.4;
|
|
48
|
+
/** `ready` ramps from 0 to 1 over this much probe time (a still image is ready at once). */
|
|
49
|
+
readonly readySeconds: 0.3;
|
|
50
|
+
/**
|
|
51
|
+
* Least skin coverage for an update: the skin map's top-mip weight, the
|
|
52
|
+
* share of the whole atlas square seen as skin (a frontal face is about 0.5).
|
|
53
|
+
*/
|
|
54
|
+
readonly minCoverage: 0.05;
|
|
55
|
+
/** Least summed tap weight for a light fit (taps fully seen), else the light keeps its value. */
|
|
56
|
+
readonly minLightTaps: 6;
|
|
57
|
+
/** Least summed tap weight for the lip and brow colours, else they keep their values. */
|
|
58
|
+
readonly minFeatureTaps: 1;
|
|
59
|
+
/**
|
|
60
|
+
* The share of the brow band (upper to lower edge) that is hair: brow hair
|
|
61
|
+
* = skin + (brow − skin) / share, from the band's mean colour.
|
|
62
|
+
*/
|
|
63
|
+
readonly browHairShare: 0.6;
|
|
64
|
+
/**
|
|
65
|
+
* The brow-hair estimate stops at this share of the band's colour in any
|
|
66
|
+
* channel: dense brows (more hair than `browHairShare`) read dark, not black.
|
|
67
|
+
*/
|
|
68
|
+
readonly browHairFloor: 0.5;
|
|
69
|
+
/** A face found again after this long gone (ms) restarts the averages. */
|
|
70
|
+
readonly reacquireSnapMs: 1000;
|
|
71
|
+
/** Fit confidence cap (also guards ambient ≤ 0); `LIGHT_FIT.maxConfidence`. */
|
|
72
|
+
readonly maxConfidence: 100;
|
|
73
|
+
}>;
|
|
74
|
+
/** The probe's quality: `auto` follows the session tier (first high, last low, any other medium). */
|
|
75
|
+
export declare const FACE_SKIN_QUALITIES: readonly ["auto", "high", "medium", "low"];
|
|
76
|
+
export type FaceSkinQuality = (typeof FACE_SKIN_QUALITIES)[number];
|
|
77
|
+
export type FaceSkinQualityKey = Exclude<FaceSkinQuality, "auto">;
|
|
78
|
+
/** What one quality tier runs. */
|
|
79
|
+
export type FaceSkinProbeTier = {
|
|
80
|
+
key: FaceSkinQualityKey;
|
|
81
|
+
/** Skin map size, texels per side. */
|
|
82
|
+
size: 64 | 128;
|
|
83
|
+
/** Probe updates per second at most (and only on new landmarks). */
|
|
84
|
+
hz: number;
|
|
85
|
+
/** Fit the light direction; off uses the key light. */
|
|
86
|
+
lightFit: boolean;
|
|
87
|
+
};
|
|
88
|
+
export declare const FACE_SKIN_PROBE_TIERS: Readonly<Record<FaceSkinQualityKey, FaceSkinProbeTier>>;
|
|
89
|
+
/**
|
|
90
|
+
* The tier for a `quality` setting and the session's quality tier
|
|
91
|
+
* (`useXRQuality().index` of `tiers.length`; index −1 or one tier = high).
|
|
92
|
+
*/
|
|
93
|
+
export declare const resolveFaceSkinProbeTier: (quality: FaceSkinQuality, tierIndex: number, tierCount: number) => FaceSkinProbeTier;
|
|
94
|
+
/** The best of several requested qualities (several consumers share one probe). */
|
|
95
|
+
export declare const bestFaceSkinQuality: (keys: Iterable<FaceSkinQualityKey>) => FaceSkinQualityKey;
|
|
96
|
+
/** Why an update was skipped (`null`: it may run). */
|
|
97
|
+
export type FaceSkinProbeGate = "absent" | "turned" | "small" | null;
|
|
98
|
+
/**
|
|
99
|
+
* The probe's freeze rule: no update while the face is absent (presence
|
|
100
|
+
* under `minPresence`), turned more than `maxYawDeg`, or shorter than
|
|
101
|
+
* `minFacePx` on the image. A frozen probe keeps its last data.
|
|
102
|
+
*/
|
|
103
|
+
export declare const faceSkinProbeGate: (input: {
|
|
104
|
+
presence: number;
|
|
105
|
+
yawDeg: number;
|
|
106
|
+
faceHeightPx: number;
|
|
107
|
+
}) => FaceSkinProbeGate;
|
|
108
|
+
/** The blend factors and flags of one probe update (uniforms of both passes). */
|
|
109
|
+
export type FaceSkinStepParams = {
|
|
110
|
+
/** ConstantAlpha factor of the unwrap into the skin and feature maps (1 = replace). */
|
|
111
|
+
mapBlend: number;
|
|
112
|
+
/** `Rf` from the skin map's top mip: 1 when the map is already averaged (half float), else the fast EMA. */
|
|
113
|
+
fastBlend: number;
|
|
114
|
+
/** `Rs`, lip and brow EMA factor. */
|
|
115
|
+
slowBlend: number;
|
|
116
|
+
/** Light EMA factor. */
|
|
117
|
+
lightBlend: number;
|
|
118
|
+
/** How much `ready` grows this update (1 = ready at once). */
|
|
119
|
+
readyStep: number;
|
|
120
|
+
/** Restart every average (first update, new texture, re-acquire, a still image). */
|
|
121
|
+
snap: boolean;
|
|
122
|
+
/** Fit the light direction. */
|
|
123
|
+
lightFit: boolean;
|
|
124
|
+
};
|
|
125
|
+
export type FaceSkinStepInput = {
|
|
126
|
+
/** Seconds since the last update (clamped to `maxDt`). */
|
|
127
|
+
dt: number;
|
|
128
|
+
/** Restart every average. */
|
|
129
|
+
snap: boolean;
|
|
130
|
+
/** A still image: snap, and ready at once. */
|
|
131
|
+
still: boolean;
|
|
132
|
+
/** The skin map has a float format (temporal blending on); RGBA8 replaces every update. */
|
|
133
|
+
halfFloat: boolean;
|
|
134
|
+
lightFit: boolean;
|
|
135
|
+
};
|
|
136
|
+
/** The blend factors of one update: EMA factors `1 − exp(−dt / τ)`, or 1 on a snap. */
|
|
137
|
+
export declare const resolveFaceSkinStepParams: (input: FaceSkinStepInput, out?: FaceSkinStepParams) => FaceSkinStepParams;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL for shaders that read the probe (any stage; makeup reads it in the
|
|
3
|
+
* vertex shader and passes flat varyings). Declares `uSkinStats` and
|
|
4
|
+
* `uSkinStatsPacked` (from `FaceSkinProbe.uniforms` / `useFaceSkin().uniforms`)
|
|
5
|
+
* and:
|
|
6
|
+
*
|
|
7
|
+
* - `vec4 faceSkinStat(int texel)`: one `FACE_SKIN_STATS` texel
|
|
8
|
+
* (0 `Rs` + ready, 1 `Rf` + coverage, 2 light gradient + ambient, 3 lip,
|
|
9
|
+
* 4 brow hair);
|
|
10
|
+
* - `vec4 faceSkinLight()`: xyz the view-space light gradient `b`, w the
|
|
11
|
+
* confidence `|b| / a` (what `vMakeupLight` holds; `MAKEUP_GLSL` falls back
|
|
12
|
+
* to the key light under 0.15).
|
|
13
|
+
*
|
|
14
|
+
* Guarded by `VXR_FACE_SKIN_STATS`: including it more than once (directly
|
|
15
|
+
* and through `MAKEUP_SKIN_STATS_VERTEX_GLSL`) declares everything once.
|
|
16
|
+
*/
|
|
17
|
+
export declare const FACE_SKIN_STATS_GLSL: string;
|
|
18
|
+
/**
|
|
19
|
+
* Vertex-side GLSL that fills the probe's flat varyings of
|
|
20
|
+
* `MAKEUP_VARYINGS_GLSL`: include it after `MAKEUP_VARYINGS_GLSL` and call
|
|
21
|
+
* `makeupWriteSkinStats()` in `main()`. Includes `FACE_SKIN_STATS_GLSL`;
|
|
22
|
+
* guarded by `VXR_MAKEUP_SKIN_STATS_VERTEX`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MAKEUP_SKIN_STATS_VERTEX_GLSL: string;
|
|
25
|
+
/** Atlas UV as the clip position; the image point and the weight per landmark. */
|
|
26
|
+
export declare const FACE_SKIN_UNWRAP_VERTEX = "\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nin vec3 position;\nin vec2 cameraUv;\nin float weight;\nout vec2 vAtlasUv;\nout vec2 vCameraUv;\nout float vWeight;\nvoid main() {\n vAtlasUv = position.xy;\n vCameraUv = cameraUv;\n vWeight = weight;\n gl_Position = vec4(position.xy * 2.0 - 1.0, 0.0, 1.0);\n}\n";
|
|
27
|
+
/**
|
|
28
|
+
* Writes the image under each atlas texel, premultiplied by its weight:
|
|
29
|
+
* target 0 (skin map) also by the static skin mask's inner half, target 1
|
|
30
|
+
* (feature map) by the weight only (lips and brows included). Linear colour;
|
|
31
|
+
* on RGBA8 the root of the colour (`(w·√c, w)`).
|
|
32
|
+
*/
|
|
33
|
+
export declare const FACE_SKIN_UNWRAP_FRAGMENT = "\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D uSource;\nuniform sampler2D uSkinMask;\nuniform float uDecodeSrgb;\nuniform float uSqrt;\nin vec2 vAtlasUv;\nin vec2 vCameraUv;\nin float vWeight;\nlayout(location = 0) out highp vec4 outSkin;\nlayout(location = 1) out highp vec4 outFeature;\n\nvec3 faceSkinSrgbToLinear(vec3 c) {\n vec3 low = c * 0.0773993808;\n vec3 high = pow(c * 0.9478672986 + 0.0521327014, vec3(2.4));\n return mix(high, low, vec3(lessThanEqual(c, vec3(0.04045))));\n}\n\nvoid main() {\n vec3 c = texture(uSource, vCameraUv).rgb;\n if (uDecodeSrgb > 0.5) c = faceSkinSrgbToLinear(c);\n c = max(c, vec3(0.0));\n vec3 e = uSqrt > 0.5 ? sqrt(c) : c;\n float w = clamp(vWeight, 0.0, 1.0);\n float skin = smoothstep(0.5, 1.0, texture(uSkinMask, vAtlasUv).r);\n outSkin = vec4(e * (w * skin), w * skin);\n outFeature = vec4(e * w, w);\n}\n";
|
|
34
|
+
/** A full-viewport triangle. */
|
|
35
|
+
export declare const FACE_SKIN_STATS_VERTEX = "\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nin vec3 position;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n}\n";
|
|
36
|
+
/** The stats pass's fragment shader (`stepFaceSkinStats`, texel by texel). Built on first use. */
|
|
37
|
+
export declare const createFaceSkinStatsFragment: () => string;
|
|
38
|
+
/**
|
|
39
|
+
* The debug readback: the stats re-packed into a 24 × 1 RGBA8 target (the
|
|
40
|
+
* packed layout), which every WebGL2 device can `readPixels` as bytes (float
|
|
41
|
+
* reads are not portable).
|
|
42
|
+
*/
|
|
43
|
+
export declare const FACE_SKIN_STATS_READBACK_FRAGMENT = "\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D uStats;\nuniform float uPacked;\nlayout(location = 0) out highp vec4 outByte;\n\nvec4 faceSkinStatFrom(sampler2D map, int texel, float packed) {\n if (packed < 0.5) return texelFetch(map, ivec2(texel, 0), 0);\n int at = texel * 3;\n vec4 hi = floor(texelFetch(map, ivec2(at, 0), 0) * 255.0 + 0.5);\n vec4 mid = floor(texelFetch(map, ivec2(at + 1, 0), 0) * 255.0 + 0.5);\n vec4 lo = floor(texelFetch(map, ivec2(at + 2, 0), 0) * 255.0 + 0.5);\n vec4 v = ((hi * 256.0 + mid) * 256.0 + lo) / 16777215.0;\n return texel == 2 ? vec4(v.xyz * 2.0 - 1.0, v.w) : v;\n}\n\nvec4 faceSkinStatPack(vec4 value, int texel, int physical) {\n if (texel == 2) value.xyz = value.xyz * 0.5 + 0.5;\n vec4 bits = floor(clamp(value, 0.0, 1.0) * 16777215.0 + 0.5);\n vec4 hi = floor(bits / 65536.0);\n vec4 rest = bits - hi * 65536.0;\n vec4 mid = floor(rest / 256.0);\n vec4 lo = rest - mid * 256.0;\n int part = physical - texel * 3;\n return (part == 0 ? hi : (part == 1 ? mid : lo)) / 255.0;\n}\n\nvoid main() {\n int physical = int(gl_FragCoord.x);\n int texel = physical / 3;\n outByte = faceSkinStatPack(faceSkinStatFrom(uStats, texel, uPacked), texel, physical);\n}\n";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The light fit: the CPU reference of the probe's stats-pass fit (S5 ports it
|
|
3
|
+
* to GLSL), so it is written as fixed-size, branch-light loops.
|
|
4
|
+
*
|
|
5
|
+
* Model: `lum_i = a + b · n_i` over skin taps, `n_i` the tap's normal and
|
|
6
|
+
* `lum_i` its skin luminance (the skin map at the low-pass mip). It is the
|
|
7
|
+
* first-order (Lambert / spherical-harmonic) term of the light on the face:
|
|
8
|
+
* `a` the ambient level, `b` the dominant direction times its strength.
|
|
9
|
+
*
|
|
10
|
+
* - Ridge-regularised weighted least squares: `λ = ridge · Σw` on `b` only,
|
|
11
|
+
* so coplanar or identical normals stay finite (the unobservable part of
|
|
12
|
+
* `b` goes to 0 instead of blowing up).
|
|
13
|
+
* - Outlier rejection (hair, beard, a hand's shadow). Occluders cover whole
|
|
14
|
+
* regions, and a region of taps can pull a plain least-squares fit far
|
|
15
|
+
* enough that reweighting alone never recovers. So the fit first solves
|
|
16
|
+
* once per candidate in `leaveOut` (all taps; without the forehead; without
|
|
17
|
+
* the jaw and chin; without either side), keeps the candidate with the
|
|
18
|
+
* smallest score over ALL taps, then reweights from it with Tukey's
|
|
19
|
+
* biweight, scale
|
|
20
|
+
* `1.4826 · median|r|` floored at `minScale · mean lum` so a perfect fit
|
|
21
|
+
* keeps every tap. Without `groups` it is the plain reweighted fit.
|
|
22
|
+
* - The candidate score is the median absolute residual (least median of
|
|
23
|
+
* squares) plus the mean of the residuals that are brighter than the
|
|
24
|
+
* model. A tap brighter than the model while facing away from the light is
|
|
25
|
+
* in attached shadow and scores 0. Occluders darken, so a candidate that
|
|
26
|
+
* explains a lit side as bright outliers loses to the side-lit one. Hard
|
|
27
|
+
* side light needs this and the left/right candidates: the shadowed half
|
|
28
|
+
* of the face breaks the plain linear fit by 30–55°.
|
|
29
|
+
* - Confidence `k = |b| / a`. Under `MAKEUP_SHADING.lightConfidenceMin` (0.15)
|
|
30
|
+
* shading falls back to the key light.
|
|
31
|
+
*
|
|
32
|
+
* The direction is in the frame of the normals given: pass rest normals for
|
|
33
|
+
* a head-frame light, or rest normals rotated by the probe-time pose for the
|
|
34
|
+
* view-space light the shader reads (`vMakeupLight`).
|
|
35
|
+
*/
|
|
36
|
+
export declare const LIGHT_FIT: Readonly<{
|
|
37
|
+
/** Ridge on `b`, relative to the total tap weight. */
|
|
38
|
+
readonly ridge: 0.001;
|
|
39
|
+
/** Reweighting passes after the first solve. */
|
|
40
|
+
readonly iterations: 4;
|
|
41
|
+
/** Tukey biweight constant, in robust standard deviations. */
|
|
42
|
+
readonly tukey: 4.685;
|
|
43
|
+
/** Robust-scale floor, relative to the weighted mean luminance. */
|
|
44
|
+
readonly minScale: 0.03;
|
|
45
|
+
/** Confidence cap (also guards `a ≤ 0`, an all-directional light). */
|
|
46
|
+
readonly maxConfidence: 100;
|
|
47
|
+
/** Confidence under which shading uses the key light. */
|
|
48
|
+
readonly confidenceMin: 0.15;
|
|
49
|
+
}>;
|
|
50
|
+
/** Tap groups (bit flags) for the leave-a-region-out candidates. */
|
|
51
|
+
export declare const LIGHT_FIT_GROUP: Readonly<{
|
|
52
|
+
readonly forehead: 1;
|
|
53
|
+
readonly jaw: 2;
|
|
54
|
+
/** Canonical +X: MediaPipe's left side of the face. */
|
|
55
|
+
readonly plusX: 4;
|
|
56
|
+
/** Canonical −X. */
|
|
57
|
+
readonly minusX: 8;
|
|
58
|
+
}>;
|
|
59
|
+
/** The candidate fits: the groups each one leaves out (0 = every tap). */
|
|
60
|
+
export declare const LIGHT_FIT_LEAVE_OUT: readonly number[];
|
|
61
|
+
export type LightFitOptions = {
|
|
62
|
+
ridge?: number;
|
|
63
|
+
iterations?: number;
|
|
64
|
+
tukey?: number;
|
|
65
|
+
minScale?: number;
|
|
66
|
+
maxConfidence?: number;
|
|
67
|
+
/** Per-tap group flags (`LIGHT_FIT_GROUP`); enables the leave-a-region-out candidates. */
|
|
68
|
+
groups?: ArrayLike<number>;
|
|
69
|
+
/** Candidate fits, as the group flags each leaves out (default `LIGHT_FIT_LEAVE_OUT`). */
|
|
70
|
+
leaveOut?: readonly number[];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The probe's 16 light-fit taps, as canonical landmark indices: skin away from
|
|
74
|
+
* the eyes, brows, lips and nostrils, spread so their normals span all three
|
|
75
|
+
* axes (forehead and nose bridge up, chin and jaw down, cheeks, cheekbones
|
|
76
|
+
* and jaw to both sides). The probe samples the skin map at each tap's
|
|
77
|
+
* `FACE_ATLAS_UVS` and fits against its rest normal.
|
|
78
|
+
*/
|
|
79
|
+
export declare const LIGHT_FIT_TAPS: readonly number[];
|
|
80
|
+
/** `LIGHT_FIT_GROUP` flags of each tap in `LIGHT_FIT_TAPS`. */
|
|
81
|
+
export declare const LIGHT_FIT_TAP_GROUPS: readonly number[];
|
|
82
|
+
/** One fit. */
|
|
83
|
+
export type LightFit = {
|
|
84
|
+
/** a: the luminance with no directional term (ambient). */
|
|
85
|
+
ambient: number;
|
|
86
|
+
/** b: direction × strength, in the normals' frame. */
|
|
87
|
+
gradient: [number, number, number];
|
|
88
|
+
/** b / |b| (`[0, 0, 1]` when b is 0). */
|
|
89
|
+
direction: [number, number, number];
|
|
90
|
+
/** |b|. */
|
|
91
|
+
strength: number;
|
|
92
|
+
/** k = |b| / a, capped at `maxConfidence`. */
|
|
93
|
+
confidence: number;
|
|
94
|
+
/** The final robust weight of each tap (0 = rejected). */
|
|
95
|
+
weights: Float64Array;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Solves `M x = y` for a symmetric positive-definite 4×4 `M` (row-major) by
|
|
99
|
+
* Cholesky. Returns false (leaving `x` untouched) when `M` is not SPD.
|
|
100
|
+
*/
|
|
101
|
+
export declare const solveSpd4: (m: ArrayLike<number>, y: ArrayLike<number>, x: Float64Array) => boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Fits `lum_i = a + b · n_i` over taps. `normals` is flat `[x, y, z, …]`
|
|
104
|
+
* (unit), `luminance` one value per tap (linear), `tapWeights` optional
|
|
105
|
+
* per-tap confidence (the skin map's coverage); a tap with weight ≤ 0 or a
|
|
106
|
+
* non-finite value is ignored.
|
|
107
|
+
*/
|
|
108
|
+
export declare const fitLight: (normals: ArrayLike<number>, luminance: ArrayLike<number>, tapWeights?: ArrayLike<number>, options?: LightFitOptions) => LightFit;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When a live probe updates: only on a new landmark result, at most `hz`
|
|
3
|
+
* times a second, and with a restart when the face comes back after more
|
|
4
|
+
* than `FACE_SKIN_PROBE.reacquireSnapMs`. Pure bookkeeping for
|
|
5
|
+
* `useFaceSkin` (one schedule per shared probe).
|
|
6
|
+
*/
|
|
7
|
+
export type FaceSkinSchedule = {
|
|
8
|
+
/** The landmark array of the last update (or of the last frozen attempt). */
|
|
9
|
+
lastLandmarks: unknown;
|
|
10
|
+
/** When the last update ran (ms), or −Infinity. */
|
|
11
|
+
lastUpdateMs: number;
|
|
12
|
+
/** When the face was last present (ms), or −Infinity. */
|
|
13
|
+
lastSeenMs: number;
|
|
14
|
+
/** A restart is owed to the next update. */
|
|
15
|
+
pendingSnap: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const createFaceSkinSchedule: () => FaceSkinSchedule;
|
|
18
|
+
/** One frame's decision. */
|
|
19
|
+
export type FaceSkinPlan = {
|
|
20
|
+
run: boolean;
|
|
21
|
+
/** Restart every average with this update. */
|
|
22
|
+
snap: boolean;
|
|
23
|
+
/** Seconds since the last update (the probe clamps it). */
|
|
24
|
+
dt: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Decides this frame. `landmarks` is the face's current result (any
|
|
28
|
+
* identity-stable object; `null` when the face is absent). Call `commit`
|
|
29
|
+
* with the probe's answer when `run` is true.
|
|
30
|
+
*/
|
|
31
|
+
export declare const planFaceSkinUpdate: (schedule: FaceSkinSchedule, input: {
|
|
32
|
+
nowMs: number;
|
|
33
|
+
landmarks: unknown;
|
|
34
|
+
hz: number;
|
|
35
|
+
}, out?: FaceSkinPlan) => FaceSkinPlan;
|
|
36
|
+
/**
|
|
37
|
+
* Records an attempt: `updated` when the probe ran (a frozen probe keeps its
|
|
38
|
+
* time, so the next update averages over one normal step).
|
|
39
|
+
*/
|
|
40
|
+
export declare const commitFaceSkinUpdate: (schedule: FaceSkinSchedule, input: {
|
|
41
|
+
nowMs: number;
|
|
42
|
+
landmarks: unknown;
|
|
43
|
+
updated: boolean;
|
|
44
|
+
}) => void;
|