@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,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eye-region masks (FACE-1: `Eyeshadow`, `Eyeliner`, `Brows`): distance
|
|
3
|
+
* fields to the lash lines and brows, evaluated per fragment on the rest
|
|
4
|
+
* position, so nothing is baked. This file is the TypeScript mirror of
|
|
5
|
+
* `MAKEUP_GLSL.eyes` (tests, triangle selection) and holds the constants
|
|
6
|
+
* the GLSL is generated from.
|
|
7
|
+
*
|
|
8
|
+
* - Distances are taken in the FRONTAL plane of the canonical head frame
|
|
9
|
+
* (`x, y` in cm). Line widths run across the lash lines and brows, which
|
|
10
|
+
* is nearly vertical, so a head turned about its vertical axis does not
|
|
11
|
+
* shorten them; only lengths along a line (a wing) read up to ~15 %
|
|
12
|
+
* shorter on the side of the eye.
|
|
13
|
+
* - Every shape is authored on the canonical −X half (landmark 33's eye and
|
|
14
|
+
* brow) and the rest point is folded onto it (`x → −|x|`), so both eyes
|
|
15
|
+
* match; which of them shows is the `uSide` weight (the person's own
|
|
16
|
+
* sides, #298). Blinks stay on mesh sides (`FACE_ATLAS_BLINK_MORPHS`).
|
|
17
|
+
* - Lash lines run from the outer corner (33, position 0) to the inner
|
|
18
|
+
* corner (133, position 1); brows from the tail (0) to the head (1).
|
|
19
|
+
*/
|
|
20
|
+
/** A frontal point or direction, cm. */
|
|
21
|
+
export type MakeupEyeVec2 = readonly [x: number, y: number];
|
|
22
|
+
/** Tuning of the eye masks (cm unless noted). The GLSL is generated from these. */
|
|
23
|
+
export declare const MAKEUP_EYE_MODEL: Readonly<{
|
|
24
|
+
/** Half-width of the split between the lid (above the eye) and the under-eye. */
|
|
25
|
+
gateCm: 0.02;
|
|
26
|
+
/** Lower zones (liner and shadow) fade out as the mesh-side blink goes from 0.35 to 0.75. */
|
|
27
|
+
blinkFade: readonly [0.35, 0.75];
|
|
28
|
+
/** Edges are never sharper than this many pixels (antialiasing). */
|
|
29
|
+
antialiasPx: 1.5;
|
|
30
|
+
liner: Readonly<{
|
|
31
|
+
/** Where the line starts tapering toward the inner corner (0 outer … 1 inner). */
|
|
32
|
+
taperStart: 0.15;
|
|
33
|
+
/** The lower line's width relative to the upper line's. */
|
|
34
|
+
lowerWidth: 0.6;
|
|
35
|
+
/** How far in from the outer corner the lower line reaches: `start + perLower · lower`. */
|
|
36
|
+
lowerReach: readonly [0.3, 0.75];
|
|
37
|
+
/** The fade at the inner end of the lower line (position units). */
|
|
38
|
+
lowerReachSoftness: 0.2;
|
|
39
|
+
/** `lower` amounts below this fade the lower line in. */
|
|
40
|
+
lowerFadeIn: 0.3;
|
|
41
|
+
/** `softness` scale into the line's edge feather. */
|
|
42
|
+
softnessScale: 0.5;
|
|
43
|
+
/** `smudge` added to the edge feather (and the width grows by `1 + smudge`). */
|
|
44
|
+
smudgeSoftness: 0.8;
|
|
45
|
+
/** The wing's tip radius, relative to the line's width; never below `wingTipMinCm`. */
|
|
46
|
+
wingTip: 0.15;
|
|
47
|
+
wingTipMinCm: 0.02;
|
|
48
|
+
/** Under the eye, the wing fades out within this far along the lower lash line. */
|
|
49
|
+
wingBelow: 0.06;
|
|
50
|
+
}>;
|
|
51
|
+
shadow: Readonly<{
|
|
52
|
+
/** Lash line to brow edge is never taken as less than this (cm), for the lid position. */
|
|
53
|
+
minGap: 0.3;
|
|
54
|
+
/** The lid colour's top edge feather (in lash → brow units): `start + perSoftness · softness`. */
|
|
55
|
+
edge: readonly [0.06, 0.3];
|
|
56
|
+
/** A sharp lid edge (a shape's `lidSharpness` 1) feathers this many cm, or the antialiasing if wider. */
|
|
57
|
+
sharpEdgeCm: 0.02;
|
|
58
|
+
/** Every lid zone fades out between these lash → brow positions (never on the brow). */
|
|
59
|
+
top: readonly [0.9, 1.02];
|
|
60
|
+
/** Fade past the outer corner: `start + perSoftness · softness` cm. */
|
|
61
|
+
outerReach: readonly [0.35, 0.4];
|
|
62
|
+
/** Fade past the inner corner, cm. */
|
|
63
|
+
innerReach: 0.35;
|
|
64
|
+
/**
|
|
65
|
+
* The lid's sides lean in toward the brow: at lid position `t` the outer
|
|
66
|
+
* and inner fades start `slope · t²` cm further in (a rounded lid shape).
|
|
67
|
+
*/
|
|
68
|
+
outerSlope: 0.3;
|
|
69
|
+
innerSlope: 0.8;
|
|
70
|
+
/** The crease band's centre follows `height` (plus a shape's lift), clamped to this range. */
|
|
71
|
+
creaseCentre: readonly [0.2, 0.9];
|
|
72
|
+
/** The crease band's half-width: `start + perSoftness · softness` (lash → brow units). */
|
|
73
|
+
creaseWidth: readonly [0.12, 0.18];
|
|
74
|
+
/** With a shape's `outer` 1, the crease fades to `1 − outerBias` at the inner corner. */
|
|
75
|
+
outerBias: 0.7;
|
|
76
|
+
/** Width of the lower lash-line shadow: `start + perLower · lower` cm. */
|
|
77
|
+
lowerWidth: readonly [0.15, 0.35];
|
|
78
|
+
/** Inner-corner highlight radius. */
|
|
79
|
+
innerRadius: 0.45;
|
|
80
|
+
/** The halo shapes' bright lid centre: radius, and how far above the lash line's middle. */
|
|
81
|
+
haloRadius: 0.45;
|
|
82
|
+
haloLift: 0.3;
|
|
83
|
+
/** The shadow wing (`winged`, `smoky`): from the outer corner, this long, this many degrees upward. */
|
|
84
|
+
wingLength: 1.3;
|
|
85
|
+
wingAngle: 25;
|
|
86
|
+
wingRadius: readonly [0.45, 0.08];
|
|
87
|
+
}>;
|
|
88
|
+
brow: Readonly<{
|
|
89
|
+
/** The tail's half-width relative to the measured brow. */
|
|
90
|
+
tailTaper: 0.75;
|
|
91
|
+
/** Hair strokes: lane spacing, stroke length, share of strokes kept, line half-width (of the spacing). */
|
|
92
|
+
strokeSpacing: 0.055;
|
|
93
|
+
strokeLength: 0.6;
|
|
94
|
+
strokeKeep: 0.6;
|
|
95
|
+
strokeWidth: readonly [0.12, 0.3];
|
|
96
|
+
/** A stroke fades in over the first `strokeFade[0]` of its segment and out from `strokeFade[1]`. */
|
|
97
|
+
strokeFade: readonly [0.15, 0.6];
|
|
98
|
+
/** How far a stroke's lane may shift sideways (of the spacing). */
|
|
99
|
+
strokeJitter: 0.4;
|
|
100
|
+
/** Strokes reach this far past the band (relative to its half-width). */
|
|
101
|
+
strokeReach: 1.15;
|
|
102
|
+
/** A stroke pattern finer than 1.5–3 px fades to its mean coverage (about 0.18; was 0.3, too dark). */
|
|
103
|
+
strokeMean: number;
|
|
104
|
+
strokeResolvePx: readonly [1.5, 3];
|
|
105
|
+
/**
|
|
106
|
+
* Hair angle from the brow line, degrees, pointing toward the tail and
|
|
107
|
+
* up: along the body, and at the head (where hairs stand up). The two
|
|
108
|
+
* patterns cross-fade over `strokeHeadBlend` of the brow's length.
|
|
109
|
+
*/
|
|
110
|
+
strokeAngle: readonly [25, 75];
|
|
111
|
+
strokeHeadBlend: readonly [0.7, 0.95];
|
|
112
|
+
/** Hair tint gain `(1 − lum(C) / lum(L)) · gain`: from `boldness` 0 to 1. */
|
|
113
|
+
hairGain: readonly [1.8, 3.2];
|
|
114
|
+
/** Width of the whole brow at `boldness` 0, 0.5 and 1. */
|
|
115
|
+
boldnessWidth: readonly [0.6, 1, 1.45];
|
|
116
|
+
}>;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* The brow strokes' hash (`makeupPcg3d`): lanes and stroke segments are
|
|
120
|
+
* offset to stay positive before the cast to unsigned, and salted apart
|
|
121
|
+
* from the flakes.
|
|
122
|
+
*/
|
|
123
|
+
export declare const MAKEUP_BROW_HASH: Readonly<{
|
|
124
|
+
offset: 4096;
|
|
125
|
+
salt: 7919;
|
|
126
|
+
}>;
|
|
127
|
+
/** Brow control points (tail → head) and capsules between them. */
|
|
128
|
+
export declare const MAKEUP_BROW_POINTS = 5;
|
|
129
|
+
export declare const MAKEUP_BROW_SEGMENTS: number;
|
|
130
|
+
/** The segment arrays the shader holds as constants: `[ax, ay, bx, by]` per segment. */
|
|
131
|
+
export type MakeupEyeLines = {
|
|
132
|
+
/** The upper lash line, outer (33) → inner (133). */
|
|
133
|
+
upper: Float32Array;
|
|
134
|
+
/** The lower lash line, outer (33) → inner (133). */
|
|
135
|
+
lower: Float32Array;
|
|
136
|
+
/** The brow's lower edge, tail (46) → head (55). */
|
|
137
|
+
browLower: Float32Array;
|
|
138
|
+
};
|
|
139
|
+
/** Where the eye regions sit on the canonical −X half (frontal cm). */
|
|
140
|
+
export type MakeupEyeGeometry = {
|
|
141
|
+
lines: MakeupEyeLines;
|
|
142
|
+
/** The outer (33) and inner (133) eye corners. */
|
|
143
|
+
outer: MakeupEyeVec2;
|
|
144
|
+
inner: MakeupEyeVec2;
|
|
145
|
+
/** Between the corners; the lid / under-eye split runs through it. */
|
|
146
|
+
middle: MakeupEyeVec2;
|
|
147
|
+
/** Unit, inner corner → outer corner. */
|
|
148
|
+
axis: MakeupEyeVec2;
|
|
149
|
+
/** Corner to corner, cm. */
|
|
150
|
+
axisLength: number;
|
|
151
|
+
/** Unit normal of `axis`, pointing up (+Y). */
|
|
152
|
+
up: MakeupEyeVec2;
|
|
153
|
+
/** The halo shapes' bright spot on the lid. */
|
|
154
|
+
lidCentre: MakeupEyeVec2;
|
|
155
|
+
/** The shadow wing's ends. */
|
|
156
|
+
shadowWing: readonly [start: MakeupEyeVec2, end: MakeupEyeVec2];
|
|
157
|
+
/** The person's own brow, tail → head: centre `x, y` and half-width, cm. */
|
|
158
|
+
brow: readonly (readonly [x: number, y: number, halfWidth: number])[];
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* A direction `degrees` upward from `axis` (an outward direction on the −X
|
|
162
|
+
* half, where outward is −X): turning from −X toward +Y is up for the person.
|
|
163
|
+
*/
|
|
164
|
+
export declare const makeupEyeRotateUp: (axis: MakeupEyeVec2, degrees: number) => [number, number];
|
|
165
|
+
/** The eye regions' geometry on the canonical face (built once, shared: do not mutate). */
|
|
166
|
+
export declare const getMakeupEyeGeometry: () => MakeupEyeGeometry;
|
|
167
|
+
/**
|
|
168
|
+
* Distance (cm) from `(x, y)` to a line of segments and the position along
|
|
169
|
+
* it (0 at its first point … 1 at its last), as `[distance, position]`.
|
|
170
|
+
* GLSL `makeupEyeLine`.
|
|
171
|
+
*/
|
|
172
|
+
export declare const makeupEyeLineDistance: (line: Float32Array, x: number, y: number, out?: [number, number]) => [number, number];
|
|
173
|
+
/**
|
|
174
|
+
* The height (y, cm) of a line whose segments run left to right in x (the
|
|
175
|
+
* upper lash line, the brow's lower edge) at `x`; past an end, the end's
|
|
176
|
+
* height. GLSL
|
|
177
|
+
* `makeupEyeLineHeight`.
|
|
178
|
+
*/
|
|
179
|
+
export declare const makeupEyeLineHeight: (line: Float32Array, x: number) => number;
|
|
180
|
+
/**
|
|
181
|
+
* 1 on the lid (above the eye), 0 under it, split where the two lash lines
|
|
182
|
+
* are equally near, and beyond the corners along the corner-to-corner axis.
|
|
183
|
+
* GLSL `makeupEyeLidGate`.
|
|
184
|
+
*/
|
|
185
|
+
export declare const makeupEyeLidGate: (x: number, y: number, upperCm: number, lowerCm: number) => number;
|
|
186
|
+
/** The lower zones' blink fade for a mesh-side blink, 0..1. GLSL `makeupEyeBlinkFade`. */
|
|
187
|
+
export declare const makeupEyeBlinkFade: (blink: number) => number;
|
|
188
|
+
/** An edge feather of at least `antialiasPx` pixels for a shape `radiusCm` wide. GLSL `makeupEyeSoftness`. */
|
|
189
|
+
export declare const makeupEyeSoftness: (softness: number, radiusCm: number, pixelCm: number) => number;
|
|
190
|
+
/**
|
|
191
|
+
* The values the eye masks read (the `MAKEUP_GLSL.eyes` uniforms, as plain
|
|
192
|
+
* numbers): `uSoftness`, `uBlink` (negX, posX), `uLiner` (width cm, lower,
|
|
193
|
+
* taper, smudge), `uWingStart` / `uWingEnd` (x, y, radius; radius 0 = no
|
|
194
|
+
* wing), `uShadow` (height, crease, lower, inner), `uShadowShape` (outer,
|
|
195
|
+
* wing, halo), `uShadowCut` (crease lift, lid sharpness), `uBrowStart` /
|
|
196
|
+
* `uBrowEnd` (x, y, half-width per segment), `uBrow` (fill, strokes, hair
|
|
197
|
+
* gain).
|
|
198
|
+
*/
|
|
199
|
+
export type MakeupEyeParams = {
|
|
200
|
+
softness: number;
|
|
201
|
+
blink: readonly [negX: number, posX: number];
|
|
202
|
+
liner: readonly [widthCm: number, lower: number, taper: number, smudge: number];
|
|
203
|
+
wingStart: ArrayLike<number>;
|
|
204
|
+
wingEnd: ArrayLike<number>;
|
|
205
|
+
shadow: readonly [height: number, crease: number, lower: number, inner: number];
|
|
206
|
+
shadowShape: readonly [outer: number, wing: number, halo: number];
|
|
207
|
+
shadowCut: readonly [creaseLift: number, lidSharpness: number];
|
|
208
|
+
browStart: ArrayLike<number>;
|
|
209
|
+
browEnd: ArrayLike<number>;
|
|
210
|
+
brow: readonly [fill: number, strokes: number, hairGain: number];
|
|
211
|
+
};
|
|
212
|
+
/** The eyeliner mask at a rest point (cm). GLSL `eyelinerShape`. */
|
|
213
|
+
export declare const evaluateEyelinerShape: (params: MakeupEyeParams, rest: readonly [number, number, number], pixelCm?: number) => number;
|
|
214
|
+
/** The eyeshadow zones at a rest point: each 0..1. GLSL `MakeupEyeshadowZones`. */
|
|
215
|
+
export type MakeupEyeshadowZones = {
|
|
216
|
+
lid: number;
|
|
217
|
+
lower: number;
|
|
218
|
+
wing: number;
|
|
219
|
+
crease: number;
|
|
220
|
+
inner: number;
|
|
221
|
+
};
|
|
222
|
+
/** The eyeshadow zones at a rest point (cm). GLSL `eyeshadowZones`. */
|
|
223
|
+
export declare const evaluateEyeshadowZones: (params: MakeupEyeParams, rest: readonly [number, number, number], pixelCm?: number) => MakeupEyeshadowZones;
|
|
224
|
+
/** The zones' union: the eyeshadow's mask. GLSL `eyeshadowMask`. */
|
|
225
|
+
export declare const makeupEyeshadowMask: (z: MakeupEyeshadowZones) => number;
|
|
226
|
+
/**
|
|
227
|
+
* The eyeshadow's colour from its zones, each laid over the last: lid and
|
|
228
|
+
* lower lash line in the shade, the wing toward the crease colour by
|
|
229
|
+
* `crease`, the crease band, then the inner corner (and halo centre).
|
|
230
|
+
* GLSL `eyeshadowColor`.
|
|
231
|
+
*/
|
|
232
|
+
export declare const makeupEyeshadowColor: (z: MakeupEyeshadowZones, shade: readonly [number, number, number], creaseColor: readonly [number, number, number], innerColor: readonly [number, number, number], crease: number) => [number, number, number];
|
|
233
|
+
/** The brow's geometry at a rest point: the band and the hair strokes. GLSL `MakeupBrow`. */
|
|
234
|
+
export type MakeupBrowSample = {
|
|
235
|
+
/** The powder band, 0..1. */
|
|
236
|
+
band: number;
|
|
237
|
+
/** The hair strokes (times `strokes`), 0..1. */
|
|
238
|
+
strokes: number;
|
|
239
|
+
/** Position along the brow: 0 tail … 1 head. */
|
|
240
|
+
along: number;
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* One hair-stroke pattern in the brow's own frame (`s` cm along the centre
|
|
244
|
+
* line from the tail, `n` cm across it, + above): lanes of strokes at
|
|
245
|
+
* `degrees` from the brow line, pointing toward the tail and up. GLSL
|
|
246
|
+
* `makeupBrowHairs`.
|
|
247
|
+
*/
|
|
248
|
+
export declare const makeupBrowHairs: (s: number, n: number, degrees: number, salt: number, pixelCm: number) => number;
|
|
249
|
+
/**
|
|
250
|
+
* The brow's own frame at a frontal point: `s` cm along the tail → head
|
|
251
|
+
* chord, `n` cm above the shaped centre line there (continuous across the
|
|
252
|
+
* control points), and the chord's length. GLSL `makeupBrowFrame`.
|
|
253
|
+
*/
|
|
254
|
+
export declare const makeupBrowFrame: (params: MakeupEyeParams, x: number, y: number) => [s: number, n: number, length: number];
|
|
255
|
+
/** The brow at a rest point (cm). GLSL `browGeometry`. */
|
|
256
|
+
export declare const evaluateBrowGeometry: (params: MakeupEyeParams, rest: readonly [number, number, number], pixelCm?: number) => MakeupBrowSample;
|
|
257
|
+
/**
|
|
258
|
+
* How much of a pixel is brow hair: `(1 − lum(C) / lum(L)) · gain`, clamped,
|
|
259
|
+
* from the camera's luminance and the local skin's (the probe's low-pass,
|
|
260
|
+
* which fills the brow from the skin around it). GLSL `browMask`.
|
|
261
|
+
*/
|
|
262
|
+
export declare const makeupBrowHairWeight: (cameraLuma: number, skinLuma: number, gain: number) => number;
|
|
263
|
+
/**
|
|
264
|
+
* The brow's mask: the band times the hair tint mixed toward a full powder
|
|
265
|
+
* fill by `fill`, joined with the strokes. GLSL `browMask`.
|
|
266
|
+
*/
|
|
267
|
+
export declare const makeupBrowMask: (brow: MakeupBrowSample, hair: number, fill: number) => number;
|
|
268
|
+
/** The `FACE_MORPH_NAMES` channels of the blink on each canonical half (`FACE_ATLAS_BLINK_MORPHS`). */
|
|
269
|
+
export declare const MAKEUP_BLINK_CHANNELS: Readonly<{
|
|
270
|
+
negX: number;
|
|
271
|
+
posX: number;
|
|
272
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Where the atlas comes from: the canonical face OBJ the SDK pins (SHA-384). */
|
|
2
|
+
export declare const FACE_ATLAS_SOURCE: {
|
|
3
|
+
readonly path: "/assets/sdk/face/v1/canonical_face_model.obj";
|
|
4
|
+
readonly integrity: "sha384-xP8YM/72TXKvbMptXB9a8JUlUf3MZQ8uLurExrsZc05v6/P5RrsaNGMUYS/BZx8A";
|
|
5
|
+
readonly vertexCount: 468;
|
|
6
|
+
readonly triangleCount: 898;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The face atlas: one UV per canonical landmark (flat `[u, v, …]`, 468 × 2,
|
|
10
|
+
* v up), the layout of the canonical OBJ's `vt` records (LipEffect designs,
|
|
11
|
+
* `Canonical_Face_Color.png`). u grows toward canonical +X (landmark 263);
|
|
12
|
+
* mirroring is exactly `u → 1 − u`. NOT `CANONICAL_FACE_UVS`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FACE_ATLAS_UVS: Float32Array;
|
|
15
|
+
/**
|
|
16
|
+
* Atlas triangles: landmark indices, three per triangle (898), in the
|
|
17
|
+
* OBJ's face order, wound counter-clockwise seen from outside. Unlike
|
|
18
|
+
* `CANONICAL_FACE_TRIANGLES` the eye and mouth openings are filled.
|
|
19
|
+
*/
|
|
20
|
+
export declare const FACE_ATLAS_TRIANGLES: Uint16Array;
|
|
21
|
+
/**
|
|
22
|
+
* `FACE_ATLAS_MIRROR[i]`: the landmark at `(−x, y, z)` of landmark i (exact).
|
|
23
|
+
* Its own inverse; the 28 midline landmarks map to themselves.
|
|
24
|
+
*/
|
|
25
|
+
export declare const FACE_ATLAS_MIRROR: Uint16Array;
|
|
26
|
+
/** Triangle indices (into FACE_ATLAS_TRIANGLES) filling each eye opening. */
|
|
27
|
+
export declare const FACE_ATLAS_EYE_FILLS: {
|
|
28
|
+
readonly negX: Uint16Array;
|
|
29
|
+
readonly posX: Uint16Array;
|
|
30
|
+
};
|
|
31
|
+
/** Triangle indices filling the mouth opening (inside the inner lip ring). */
|
|
32
|
+
export declare const FACE_ATLAS_MOUTH_FILL: Uint16Array;
|
|
33
|
+
/** Triangle indices of the two nostril openings. */
|
|
34
|
+
export declare const FACE_ATLAS_NOSTRILS: Uint16Array;
|
|
35
|
+
/** The face oval: the mesh boundary, in the triangle winding, from landmark 10. */
|
|
36
|
+
export declare const FACE_ATLAS_OVAL_RING: readonly number[];
|
|
37
|
+
/** Lash rings (eye openings), from the outer corner along the lower lid. */
|
|
38
|
+
export declare const FACE_ATLAS_EYE_RINGS: {
|
|
39
|
+
readonly negX: readonly number[];
|
|
40
|
+
readonly posX: readonly number[];
|
|
41
|
+
};
|
|
42
|
+
/** Outer and inner lip rings (MediaPipe FACEMESH_LIPS), from mouth corner 61. */
|
|
43
|
+
export declare const FACE_ATLAS_LIP_RINGS: {
|
|
44
|
+
readonly outer: readonly number[];
|
|
45
|
+
readonly inner: readonly number[];
|
|
46
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout of the skin probe's statistics texture (`FaceSkinProbe.lightingMap`,
|
|
3
|
+
* `FACE_SKIN_STATS`), as the atlas vertex chunk reads it: `width` texels,
|
|
4
|
+
* read once per vertex through `FACE_SKIN_STATS_GLSL` (plain floats, or three
|
|
5
|
+
* bytes per value in the packed RGBA8 layout, `uSkinStatsPacked`) and passed
|
|
6
|
+
* to the fragment shader as flat varyings (no probe fetches per fragment
|
|
7
|
+
* except the local low-pass).
|
|
8
|
+
*
|
|
9
|
+
* | Texel | rgb | a |
|
|
10
|
+
* | --- | --- | --- |
|
|
11
|
+
* | `skinSlow` | Rs: the settled skin, linear | ready, 0..1 |
|
|
12
|
+
* | `skinFast` | Rf: the skin under the current light, linear | coverage |
|
|
13
|
+
* | `light` | the light gradient `b` in VIEW space (`vMakeupLight` gets `normalize`-able `b` and the confidence `|b| / a`) | ambient `a` |
|
|
14
|
+
* | `lip` | the person's own lip colour, linear | — |
|
|
15
|
+
* | `brow` | the person's own brow-hair colour, linear | — |
|
|
16
|
+
*
|
|
17
|
+
* A texture narrower than `width` (none bound yet: three binds a 1×1 empty
|
|
18
|
+
* texture for `null`) reads as "not ready", so layers draw before the probe
|
|
19
|
+
* exists.
|
|
20
|
+
*/
|
|
21
|
+
export declare const FACE_SKIN_STATS_TEXELS: Readonly<{
|
|
22
|
+
width: 8;
|
|
23
|
+
skinSlow: 0;
|
|
24
|
+
skinFast: 1;
|
|
25
|
+
light: 2;
|
|
26
|
+
lip: 3;
|
|
27
|
+
brow: 4;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* The per-landmark attributes of a face-atlas surface geometry, declared
|
|
31
|
+
* for a vertex shader. three.js declares `position`, `normal` and `uv`
|
|
32
|
+
* itself on a `ShaderMaterial`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FACE_ATLAS_ATTRIBUTES_GLSL = "\nattribute vec3 basePosition;\nattribute vec3 restPosition;\nattribute vec3 restNormal;\nattribute float edge;\nattribute float lipEdge;\nattribute float eyeRing;\n";
|
|
35
|
+
/**
|
|
36
|
+
* `MAKEUP_GLSL.atlasVertex`: the complete vertex shader of a makeup layer on
|
|
37
|
+
* the face-atlas surface. It writes every varying of `MAKEUP_VARYINGS_GLSL`:
|
|
38
|
+
* the camera at the un-warped point (`basePosition`, the FaceWarp3D
|
|
39
|
+
* pattern), the atlas uv, the rest point and normals, the view position, the
|
|
40
|
+
* edge / lip / eye attributes, the head's up axis, and the probe statistics
|
|
41
|
+
* from `uSkinStats` / `uSkinStatsPacked` (`FACE_SKIN_STATS_TEXELS`, read with
|
|
42
|
+
* the probe's own `MAKEUP_SKIN_STATS_VERTEX_GLSL`, so the float and packed
|
|
43
|
+
* layouts and the light's confidence match the probe) as flat varyings.
|
|
44
|
+
* `gl_Position` is computed exactly as the self-occlusion pre-pass does.
|
|
45
|
+
*/
|
|
46
|
+
export declare const MAKEUP_ATLAS_VERTEX_GLSL: string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The varyings between the atlas vertex chunk and the makeup fragment chunks.
|
|
3
|
+
* The vertex side declares the same string: three.js turns `varying` into
|
|
4
|
+
* `out` / `in` for each stage (every ShaderMaterial compiles as GLSL ES 3.00),
|
|
5
|
+
* and `flat` carries the probe stats the vertex shader fetches once.
|
|
6
|
+
*
|
|
7
|
+
* - `vMakeupCamera`: clip-space `xyw` of the UN-warped point (`basePosition`);
|
|
8
|
+
* the camera is sampled at `xy / z * 0.5 + 0.5` (the FaceWarp3D pattern).
|
|
9
|
+
* - `vMakeupUv`: the face-atlas coordinate (`FACE_ATLAS_UVS`), for the skin map.
|
|
10
|
+
* - `vMakeupRest`: the rest position in canonical cm (masks, sides, flakes).
|
|
11
|
+
* - `vMakeupNormal`: the live metric normal in view space.
|
|
12
|
+
* - `vMakeupFlakeNormal`: the rest normal rotated by the pose, view space.
|
|
13
|
+
* - `vMakeupViewPosition`: the view-space position.
|
|
14
|
+
* - `vMakeupEdge`: S1's `edge` attribute passed through unchanged: the
|
|
15
|
+
* distance to the face oval along the surface, cm (faded in over
|
|
16
|
+
* `MAKEUP_SHADING.edgeFadeCm`).
|
|
17
|
+
* - `vMakeupLipEdge`, `vMakeupEyeRing`: the `lipEdge` and `eyeRing` attributes.
|
|
18
|
+
* - flat `vMakeupSkinSlow` / `vMakeupSkinFast`: the probe's Rs / Rf, linear.
|
|
19
|
+
* - flat `vMakeupSkinReady`: 0 until the probe has data, then 1.
|
|
20
|
+
* - flat `vMakeupLight`: xyz the fitted light direction in VIEW space (any
|
|
21
|
+
* length, 0 = none), w the fit's confidence `|b| / a`.
|
|
22
|
+
* - flat `vMakeupLipColor` / `vMakeupBrowColor`: the person's own lip and
|
|
23
|
+
* brow-hair colours, linear.
|
|
24
|
+
* - flat `vMakeupHeadUp`: the head frame's +Y in view space
|
|
25
|
+
* (`normalMatrix * vec3(0.0, 1.0, 0.0)`), the flakes' tangent frame.
|
|
26
|
+
*/
|
|
27
|
+
export declare const MAKEUP_VARYINGS_GLSL = "\nvarying vec3 vMakeupCamera;\nvarying vec2 vMakeupUv;\nvarying vec3 vMakeupRest;\nvarying vec3 vMakeupNormal;\nvarying vec3 vMakeupFlakeNormal;\nvarying vec3 vMakeupViewPosition;\nvarying float vMakeupEdge;\nvarying float vMakeupLipEdge;\nvarying float vMakeupEyeRing;\nflat varying vec3 vMakeupSkinSlow;\nflat varying vec3 vMakeupSkinFast;\nflat varying float vMakeupSkinReady;\nflat varying vec4 vMakeupLight;\nflat varying vec3 vMakeupLipColor;\nflat varying vec3 vMakeupBrowColor;\nflat varying vec3 vMakeupHeadUp;\n";
|
|
28
|
+
/**
|
|
29
|
+
* `MAKEUP_GLSL.common`: what every makeup fragment shader starts with.
|
|
30
|
+
* Constants, the fragment output, the varyings, the shared uniforms
|
|
31
|
+
* (`createMakeupShadingUniforms()` supplies every one), the `MakeupSample`
|
|
32
|
+
* struct and `makeupSample()`, which reads the camera, the three skin
|
|
33
|
+
* references, the light, the rest point, the pixel footprint, the side
|
|
34
|
+
* weight and the fades. Call `makeupSample()` first in `main()`: it takes
|
|
35
|
+
* screen-space derivatives.
|
|
36
|
+
*
|
|
37
|
+
* `makeupSample()` is `makeupSampleGeometry()` (derivatives, rest point,
|
|
38
|
+
* normals, light, sides and fades: no texture reads) then
|
|
39
|
+
* `makeupSampleColor(s)` (the camera and skin texture reads, each at an
|
|
40
|
+
* explicit LOD, so they are valid after a `discard`). A shader with a mask
|
|
41
|
+
* calls the two halves around its early `discard`, so fragments outside the
|
|
42
|
+
* shape skip the texture reads:
|
|
43
|
+
*
|
|
44
|
+
* ```glsl
|
|
45
|
+
* MakeupSample s = makeupSampleGeometry();
|
|
46
|
+
* float mask = blushShape(s.rest);
|
|
47
|
+
* if (mask * s.fade < 1.0 / 255.0) discard;
|
|
48
|
+
* makeupSampleColor(s);
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* Under `glslVersion: THREE.GLSL3` three.js declares no output, so this
|
|
52
|
+
* chunk declares `pc_fragColor` and maps `gl_FragColor` to it; under the
|
|
53
|
+
* default version three.js already has.
|
|
54
|
+
*/
|
|
55
|
+
export declare const MAKEUP_COMMON_GLSL: string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* `MAKEUP_GLSL.design` (after `common`; any place after it): creator art in
|
|
4
|
+
* the face atlas (`MakeupDesign`). The art is painted as on an unmirrored
|
|
5
|
+
* photo (image-left = the person's right, `FACE_ATLAS_UVS`, image top
|
|
6
|
+
* `v = 1`); `makeupDesignUv` samples `(1 − u, v)` when `uPersonLeftSign` is
|
|
7
|
+
* negative (the mirrored webcam), so each side of the art stays on the
|
|
8
|
+
* person's own side on every feed. The atlas is symmetric to 0.001, so the
|
|
9
|
+
* flip is exact.
|
|
10
|
+
*
|
|
11
|
+
* `makeupDesignSample(uv)` returns the art at an atlas uv as linear rgb and
|
|
12
|
+
* straight alpha: it divides out premultiplied alpha
|
|
13
|
+
* (`uDesignPremultiplied`) and decodes sRGB bytes (`uDesignSrgb`; a texture
|
|
14
|
+
* tagged `SRGBColorSpace` is decoded by the GPU instead). It reads the
|
|
15
|
+
* texture with implicit derivatives (mipmapped art stays clean on a small
|
|
16
|
+
* face), so call it before any `discard`:
|
|
17
|
+
*
|
|
18
|
+
* ```glsl
|
|
19
|
+
* MakeupSample s = makeupSampleGeometry();
|
|
20
|
+
* vec4 art = makeupDesignSample(s.uv);
|
|
21
|
+
* if (art.a * s.fade < 1.0 / 255.0) discard;
|
|
22
|
+
* makeupSampleColor(s);
|
|
23
|
+
* makeupOutput(s, makeupFinish(s, art.rgb * uColor, art.a));
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Uniforms: `createMakeupDesignUniforms()`; `setMakeupDesignTexture` sets
|
|
27
|
+
* the texture and its two flags.
|
|
28
|
+
*/
|
|
29
|
+
export declare const MAKEUP_DESIGN_GLSL = "\nuniform sampler2D uDesignMap;\nuniform float uDesignSrgb;\nuniform float uDesignPremultiplied;\n\n// The art's uv on this feed: (1 - u, v) on a mirrored feed (uPersonLeftSign < 0).\nvec2 makeupDesignUv(vec2 uv) {\n return vec2(uPersonLeftSign < 0.0 ? 1.0 - uv.x : uv.x, uv.y);\n}\n\nvec3 makeupDesignDecode(vec3 c) {\n vec3 low = c / 12.92;\n vec3 high = pow((c + 0.055) / 1.055, vec3(2.4));\n return mix(low, high, step(vec3(0.04045), c));\n}\n\n// The art at an atlas uv: linear rgb, straight alpha. Implicit derivatives: call before any discard.\nvec4 makeupDesignSample(vec2 uv) {\n vec4 texel = texture(uDesignMap, makeupDesignUv(uv));\n float a = clamp(texel.a, 0.0, 1.0);\n vec3 c = uDesignPremultiplied > 0.5 ? texel.rgb / max(a, 1e-4) : texel.rgb;\n c = clamp(c, 0.0, 1.0);\n return vec4(uDesignSrgb > 0.5 ? makeupDesignDecode(c) : c, a);\n}\n";
|
|
30
|
+
/**
|
|
31
|
+
* The uniforms `MAKEUP_GLSL.design` declares, empty: no art (three binds a
|
|
32
|
+
* transparent 1×1 texture for `null`, so nothing is painted).
|
|
33
|
+
*/
|
|
34
|
+
export declare const createMakeupDesignUniforms: () => {
|
|
35
|
+
/** The art, in the face atlas (v up, as a texture loaded with `flipY`). */
|
|
36
|
+
uDesignMap: {
|
|
37
|
+
value: THREE.Texture | null;
|
|
38
|
+
};
|
|
39
|
+
/** 1 when the texture holds sRGB bytes the shader decodes (not tagged `SRGBColorSpace` or linear). */
|
|
40
|
+
uDesignSrgb: {
|
|
41
|
+
value: number;
|
|
42
|
+
};
|
|
43
|
+
/** 1 when the texture was uploaded premultiplied (`texture.premultiplyAlpha`). */
|
|
44
|
+
uDesignPremultiplied: {
|
|
45
|
+
value: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** The uniforms `MAKEUP_GLSL.design` reads. */
|
|
49
|
+
export type MakeupDesignUniforms = ReturnType<typeof createMakeupDesignUniforms>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* `MAKEUP_GLSL.eyes` (after `common`, `shading`, `sparkle`, `finish` and
|
|
4
|
+
* `shapes`): the eye regions' masks on the rest point, mirrored by
|
|
5
|
+
* `lib/face-atlas/eyes.ts`. Lash lines and the brow's lower edge are
|
|
6
|
+
* constants; everything a setting moves is a uniform, so no edit
|
|
7
|
+
* recompiles.
|
|
8
|
+
*
|
|
9
|
+
* - `eyelinerShape(s.rest, s.pixelCm)`: the liner's mask.
|
|
10
|
+
* - `eyeshadowZones(s.rest, s.pixelCm)` → `MakeupEyeshadowZones`;
|
|
11
|
+
* `eyeshadowMask(z)` and `eyeshadowColor(z, makeupShade(s))`.
|
|
12
|
+
* - `browGeometry(s.rest, s.pixelCm)` → `MakeupBrow` (band and strokes;
|
|
13
|
+
* `browReach` bounds it before the camera is read) and
|
|
14
|
+
* `browMask(s, brow)`, which needs `makeupSampleColor(s)` first (the
|
|
15
|
+
* real hairs are where the camera is darker than the local skin);
|
|
16
|
+
* `browShape(s)` is both.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MAKEUP_EYES_GLSL: string;
|
|
19
|
+
/**
|
|
20
|
+
* The uniforms `MAKEUP_GLSL.eyes` declares, neutral (nothing paints until
|
|
21
|
+
* a region writes its settings). Colours are linear; brow capsules are
|
|
22
|
+
* `[x, y, halfWidth]` per segment (Float32Arrays whose identity never
|
|
23
|
+
* changes).
|
|
24
|
+
*/
|
|
25
|
+
export declare const createMakeupEyeUniforms: () => {
|
|
26
|
+
/** The blink on each canonical half, `(negX, posX)`, 0..1 (the face rig's morphs). */
|
|
27
|
+
uBlink: {
|
|
28
|
+
value: THREE.Vector2;
|
|
29
|
+
};
|
|
30
|
+
/** Eyeliner: `(width cm, lower 0..1, inner taper, smudge)`. */
|
|
31
|
+
uLiner: {
|
|
32
|
+
value: THREE.Vector4;
|
|
33
|
+
};
|
|
34
|
+
/** The liner wing's start and end: `(x, y, radius)` cm on the −X half; radius 0 = no wing. */
|
|
35
|
+
uWingStart: {
|
|
36
|
+
value: THREE.Vector3;
|
|
37
|
+
};
|
|
38
|
+
uWingEnd: {
|
|
39
|
+
value: THREE.Vector3;
|
|
40
|
+
};
|
|
41
|
+
/** Eyeshadow: `(height, crease, lower, inner)`, each 0..1. */
|
|
42
|
+
uShadow: {
|
|
43
|
+
value: THREE.Vector4;
|
|
44
|
+
};
|
|
45
|
+
/** The eyeshadow shape's `(outer bias, wing, halo)`, each 0..1. */
|
|
46
|
+
uShadowShape: {
|
|
47
|
+
value: THREE.Vector3;
|
|
48
|
+
};
|
|
49
|
+
/** The eyeshadow shape's `(crease lift, lid sharpness)`, each 0..1 (0, 0: a crease blended into the lid). */
|
|
50
|
+
uShadowCut: {
|
|
51
|
+
value: THREE.Vector2;
|
|
52
|
+
};
|
|
53
|
+
/** Crease and inner-corner colours, linear. */
|
|
54
|
+
uShadowCreaseColor: {
|
|
55
|
+
value: THREE.Color;
|
|
56
|
+
};
|
|
57
|
+
uShadowInnerColor: {
|
|
58
|
+
value: THREE.Color;
|
|
59
|
+
};
|
|
60
|
+
/** The brow's capsules, tail → head: `[x, y, halfWidth]` at each start and end, cm. */
|
|
61
|
+
uBrowStart: {
|
|
62
|
+
value: Float32Array<ArrayBuffer>;
|
|
63
|
+
};
|
|
64
|
+
uBrowEnd: {
|
|
65
|
+
value: Float32Array<ArrayBuffer>;
|
|
66
|
+
};
|
|
67
|
+
/** Brows: `(fill, strokes, hair gain)`. */
|
|
68
|
+
uBrow: {
|
|
69
|
+
value: THREE.Vector3;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/** The uniforms `MAKEUP_GLSL.eyes` reads. */
|
|
73
|
+
export type MakeupEyeUniforms = ReturnType<typeof createMakeupEyeUniforms>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `MAKEUP_GLSL.finish` (after `common`, `shading` and `sparkle`): the six
|
|
3
|
+
* finishes as one function. Mirrors `makeupFinishLayer` in
|
|
4
|
+
* `lib/face-atlas/shading.ts`; the finish is a uniform (`uFinish`), so
|
|
5
|
+
* switching it never recompiles.
|
|
6
|
+
*
|
|
7
|
+
* | finish | diffuse | highlight |
|
|
8
|
+
* |----------|-------------------------------|--------------------------------------------------------|
|
|
9
|
+
* | matte | hard clip (shine removed) | none |
|
|
10
|
+
* | satin | soft clip | 0.35 Hcam + broad lobe (rough 0.6) x shine |
|
|
11
|
+
* | gloss | soft clip | (1 + 1.5 shine) Hcam + sharp lobe (rough 0.12) + Fresnel, white, x mask (not opacity) |
|
|
12
|
+
* | shimmer | as satin | satin + dense micro-flakes x lobe, tinted |
|
|
13
|
+
* | metallic | D x mix(1, 0.45, coverage) | Fresnel(F0 = shade) x (coverage x environment + Hcam + lobe (rough 0.35)) |
|
|
14
|
+
* | glitter | satin base + flake bodies | satin + sparse flakes (normals ~40 deg, hue jitter) x mask |
|
|
15
|
+
*
|
|
16
|
+
* Coverage 0 never lightens the skin: a sheer metallic is the sheer filter
|
|
17
|
+
* plus its lobe, Fresnel and camera highlight. The "x mask" terms keep their
|
|
18
|
+
* strength at low opacity and fade out below
|
|
19
|
+
* `MAKEUP_FINISH_MODEL.maskTermsFullOpacity`, so opacity 0 shows nothing.
|
|
20
|
+
*
|
|
21
|
+
* `makeupFinish(s, color, mask)` returns a `MakeupLayer` for `makeupOutput`.
|
|
22
|
+
* `mask` is the region's shape; `s.fade` applies on top.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MAKEUP_FINISH_GLSL: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A JS number as a GLSL float literal: `1` → `"1.0"`, `0.15` → `"0.15"`, `1e-7` → `"1e-7"`. */
|
|
2
|
+
export declare const glslFloat: (x: number) => string;
|
|
3
|
+
/** A JS triple as a GLSL `vec3(...)` literal. */
|
|
4
|
+
export declare const glslVec3: (v: readonly [number, number, number]) => string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL chunks for makeup shaders (FACE-1).
|
|
3
|
+
*
|
|
4
|
+
* `atlasVertex` is the whole vertex shader of a layer on the face-atlas
|
|
5
|
+
* surface (`FaceAtlasLayer`): it writes every varying the fragment chunks
|
|
6
|
+
* read. For the fragment shader, concatenate these in order, then your
|
|
7
|
+
* `main()`:
|
|
8
|
+
*
|
|
9
|
+
* `common` → `shading` → `sparkle` → `finish` → `shapes`
|
|
10
|
+
*
|
|
11
|
+
* ```glsl
|
|
12
|
+
* void main() {
|
|
13
|
+
* MakeupSample s = makeupSample(); // first: it takes derivatives
|
|
14
|
+
* float mask = blushShape(s.rest); // or your own shape
|
|
15
|
+
* makeupOutput(s, makeupFinish(s, makeupShade(s), mask));
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* With a mask, split the sample around an early out, so fragments outside
|
|
20
|
+
* the shape read no texture:
|
|
21
|
+
*
|
|
22
|
+
* ```glsl
|
|
23
|
+
* MakeupSample s = makeupSampleGeometry(); // derivatives, rest point, fades
|
|
24
|
+
* float mask = blushShape(s.rest);
|
|
25
|
+
* if (mask * s.fade < 1.0 / 255.0) discard;
|
|
26
|
+
* makeupSampleColor(s); // camera and skin, explicit LODs
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* `common` alone with `shading` is enough for a matte layer:
|
|
30
|
+
* `makeupOutput(s, makeupDiffuse(s, uColor, uCoverage), mask * s.fade * uOpacity, vec3(0.0))`.
|
|
31
|
+
* Draw with `MAKEUP_BLENDING` (premultiplied over). A custom vertex side
|
|
32
|
+
* declares `MAKEUP_VARYINGS_GLSL` and writes every varying in it.
|
|
33
|
+
*
|
|
34
|
+
* `design` (after `common`) samples creator art in the face atlas
|
|
35
|
+
* (`MakeupDesign`): `makeupDesignSample(s.uv)` returns linear rgb and
|
|
36
|
+
* straight alpha, flipped on mirrored feeds so each side stays on the
|
|
37
|
+
* person's own side. Call it before any `discard`.
|
|
38
|
+
*
|
|
39
|
+
* `eyes` (after `shapes`) holds the eye regions' masks (`Eyeshadow`,
|
|
40
|
+
* `Eyeliner`, `Brows`): `eyelinerShape`, `eyeshadowZones` / `eyeshadowMask`
|
|
41
|
+
* / `eyeshadowColor`, and `browGeometry` / `browReach` / `browMask`, on the
|
|
42
|
+
* rest point in canonical cm, with blink fades from `uBlink`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const MAKEUP_GLSL: Readonly<{
|
|
45
|
+
atlasVertex: string;
|
|
46
|
+
common: string;
|
|
47
|
+
shading: string;
|
|
48
|
+
sparkle: string;
|
|
49
|
+
finish: string;
|
|
50
|
+
shapes: string;
|
|
51
|
+
design: "\nuniform sampler2D uDesignMap;\nuniform float uDesignSrgb;\nuniform float uDesignPremultiplied;\n\n// The art's uv on this feed: (1 - u, v) on a mirrored feed (uPersonLeftSign < 0).\nvec2 makeupDesignUv(vec2 uv) {\n return vec2(uPersonLeftSign < 0.0 ? 1.0 - uv.x : uv.x, uv.y);\n}\n\nvec3 makeupDesignDecode(vec3 c) {\n vec3 low = c / 12.92;\n vec3 high = pow((c + 0.055) / 1.055, vec3(2.4));\n return mix(low, high, step(vec3(0.04045), c));\n}\n\n// The art at an atlas uv: linear rgb, straight alpha. Implicit derivatives: call before any discard.\nvec4 makeupDesignSample(vec2 uv) {\n vec4 texel = texture(uDesignMap, makeupDesignUv(uv));\n float a = clamp(texel.a, 0.0, 1.0);\n vec3 c = uDesignPremultiplied > 0.5 ? texel.rgb / max(a, 1e-4) : texel.rgb;\n c = clamp(c, 0.0, 1.0);\n return vec4(uDesignSrgb > 0.5 ? makeupDesignDecode(c) : c, a);\n}\n";
|
|
52
|
+
eyes: string;
|
|
53
|
+
}>;
|
|
54
|
+
export { MAKEUP_VARYINGS_GLSL } from './common';
|
|
55
|
+
export { FACE_ATLAS_ATTRIBUTES_GLSL, FACE_SKIN_STATS_TEXELS } from './atlasVertex';
|
|
56
|
+
export { createMakeupShadingUniforms, type MakeupShadingUniforms } from './uniforms';
|
|
57
|
+
export { createMakeupShapeUniforms, type MakeupShapeUniforms } from './shapes';
|
|
58
|
+
export { createMakeupDesignUniforms, type MakeupDesignUniforms } from './design';
|
|
59
|
+
export { createMakeupEyeUniforms, type MakeupEyeUniforms } from './eyes';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `MAKEUP_GLSL.shading` (after `common`): skin-relative light terms, the
|
|
3
|
+
* diffuse (sheer / opaque coverage), auto shades and the output operator.
|
|
4
|
+
* Mirrors `makeupLighting`, `makeupDiffuse`, `makeupAutoShade` and
|
|
5
|
+
* `makeupOutput` in `lib/face-atlas/shading.ts`.
|
|
6
|
+
*
|
|
7
|
+
* - `S = lum(C) / lum(Rs)`: light on this pixel relative to the GLOBAL
|
|
8
|
+
* settled skin, so a side-lit face keeps its shadow side and skin tone
|
|
9
|
+
* never enters the paint.
|
|
10
|
+
* - `L` (local low-pass) only clips the skin's own shine out of the diffuse
|
|
11
|
+
* (`Sd`) and measures the real highlight `Hcam`.
|
|
12
|
+
* - `makeupOutput` writes premultiplied `(k·enc(D) + enc(base+H) − enc(base), k)`;
|
|
13
|
+
* draw it with `MAKEUP_BLENDING` (One, OneMinusSrcAlpha): opacity is linear.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MAKEUP_SHADING_GLSL: string;
|