為擴增臉孔建立自訂紋理和 3D 模型
如要實作擴增臉部功能,您需要為下列項目自訂紋理和模型:
疊加在已識別的臉部網格上這些資產是由藝人建立
建立 3D 模型和動畫軟體,並將匯出成 FBX 格式匯出
檔案。
標準檔案
SDK 隨附 canonical_face_mesh.fbx
檔案和
canonical_face_mesh.psd
檔案,協助藝人建立會疊加在素材資源中的素材資源
正確啟動 ARCore 偵測到的臉孔。這些檔案位於
assets/canonical_face_mesh.fbx
資料夾。
使用 FBX 檔案建立 3D 模型
FBX 檔案包含臉部網格拓撲、UV 紋理座標,
設計及定義支援臉部表情的
附加資產為確保裝置與 ARCore 相容,FBX 檔案
都會使用支援的設定儲存
此檔案包含不應匯出為一部分的參考 facemesh
最終的 FBXARCore 會在以下位置產生並更新一個不同的臉部網格:
執行階段。
使用 PSD 檔案建立 2D 紋理
.psd
臉孔網格參照紋理,可用來瞭解模型的
藝術家在執行階段融入使用者的臉部特徵,包括
四層
- 遮罩:顯示眼睛、鼻子和嘴巴在紋理中的位置。
- 線條:描述使用者臉部特徵與
執行特定動作
- UV:代表 468 點表面紋理網格的三角化,
- 背景:中性灰色背景圖層,另一個
讓所有元件看起來都清楚明瞭

如果修改 PSD 檔案,您所做的變更應會立即顯示
或匯出作業。
自訂標準臉孔網格
如使用
SDK 中包含 assets/canonical_face_mesh.fbx
,這些設定也
匯出 FBX 檔案時所需的必要資訊:
確保所有自訂網格看起來像是相關的骨頭或區域。
請使用下列階層:
asset
|__root
| |__NOSE_TIP
| |__FOREHEAD_RIGHT
| |__FOREHEAD_LEFT
|__facemesh <-- for reference
|__ <-- place additional custom 3D meshes here
請勿匯出內含的 facemesh
模型。這個網格僅供參考,
ARCore 會在執行階段建立單獨的臉部網格。在facemesh
使用 UV
做為建立自訂臉部網格紋理時的參考。
將自訂網格放置為 asset
節點的子項。
支援使用命名空間。
這個素材資源包含四個骨頭,包括 root
和 NOSE_TIP
,
FOREHEAD_RIGHT
和 FOREHEAD_LEFT
個區域。請不要變更
這些骨頭。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-13 (世界標準時間)。
[null,null,["上次更新時間:2024-09-13 (世界標準時間)。"],[[["Augmented Faces uses custom textures and 3D models (FBX files) created by artists to overlay onto detected faces."],["The SDK provides a canonical face mesh (FBX and PSD files) to guide asset creation and ensure compatibility with ARCore."],["Artists use the FBX file to create 3D models, ensuring correct topology and rigging for facial regions."],["The PSD file aids in creating 2D textures, providing layers to align artwork with user facial features during runtime."],["When exporting FBX files, specific settings and hierarchy must be followed for seamless integration with ARCore's face tracking."]]],["Artists create custom 3D models and 2D textures in FBX and PSD formats for overlaying on detected face meshes. The SDK provides `canonical_face_mesh.fbx` and `.psd` files for guidance. The FBX file defines face mesh topology and facial regions; `.psd` guides texture alignment with features, using layers for masks, lines, UVs, and background. When exporting custom FBX files, ensure custom meshes are skinned to specified bones and follow the outlined hierarchy, excluding the reference `facemesh`.\n"]]