為擴增臉孔建立自訂紋理和 3D 模型
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如要實作擴增臉孔,您需要自訂紋理和模型,以便疊加在已識別的臉孔網格上。這些素材資源是由藝術家提前在 3D 建模和動畫軟體中建立,並匯出為 FBX 檔案。
標準檔案
SDK 會隨附 canonical_face_mesh.fbx
檔案和 canonical_face_mesh.psd
檔案,協助藝術家建立資產,以便正確疊加在 ARCore 偵測到的臉上。這些檔案位於 assets/canonical_face_mesh.fbx
資料夾中。
使用 FBX 檔案建立 3D 模型
FBX 檔案包含臉部網格拓樸、UV 紋理座標和裝備,這些元素會定義用於建立及附加資產的支援臉部區域。為確保 FBX 檔案與 ARCore 相容,請使用支援的設定儲存檔案。
這個檔案包含參照 facemesh
,不應匯出為最終 FBX 的一部分。ARCore 會在執行階段產生及更新個別的臉部網格。
使用 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 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eAugmented Faces in ARCore uses custom 3D models and 2D textures, created by artists and exported as FBX files, to overlay onto detected faces.\u003c/p\u003e\n"],["\u003cp\u003eARCore provides a canonical face mesh (FBX and PSD files) to guide the creation of compatible assets for accurate overlay on user faces.\u003c/p\u003e\n"],["\u003cp\u003eThe FBX file defines the face mesh structure and regions, and any custom 3D models should be skinned to its associated bones while adhering to a specific hierarchy.\u003c/p\u003e\n"],["\u003cp\u003eThe PSD file provides a reference texture with layers for mask, lines, UVs, and background, aiding artists in aligning textures with facial features.\u003c/p\u003e\n"],["\u003cp\u003eWhen exporting custom FBX files, the reference 'facemesh' should be excluded, as ARCore generates its own face mesh at runtime.\u003c/p\u003e\n"]]],[],null,["# Create custom textures and 3D models for Augmented Faces\n\nTo implement Augmented Faces, you need customized textures and models for\noverlaying on identified face meshes. These assets are created by artists\nahead of time in 3D modeling and animation software, and exported as FBX\nfiles.\n\nCanonical files\n---------------\n\nThe SDKs ship with a `canonical_face_mesh.fbx` file and a\n`canonical_face_mesh.psd` file to help artists create assets that will overlay\nproperly onto faces detected by ARCore. These files can be found in the\n`assets/canonical_face_mesh.fbx` folder.\n| **Note:** Both the FBX and PSD files are included in the [public iOS GitHub repository](https://github.com/google-ar/arcore-ios-sdk/tree/master/Assets), but are not shipped as part of the ARCore Cocoapod.\n\nCreate 3D models with the FBX file\n----------------------------------\n\nThe FBX file contains the face mesh topology, UV texture coordinates, and\nrig that defines the supported facial regions provided for creating and\nattaching assets. To ensure they're compatible with ARCore, FBX files should\nbe saved using supported settings.\n\nThis file contains a reference `facemesh` that should not be exported as part of\nthe final FBX. ARCore will generate and update a separate face mesh at\nruntime.\n\nCreate 2D textures with the PSD file\n------------------------------------\n\nThe `.psd` face mesh reference texture is used to see how a texture that an\nartist creates lines up with a user's facial features at runtime. It includes\nfour layers:\n\n- **Mask:** Shows where the eyes, nostrils, and mouth are located in the texture.\n- **Lines:** Guidelines that show how a user's facial features line up with a texture during runtime.\n- **UVs:** Represents triangulation of the 468 point face texture mesh.\n- **Background:** A neutral gray background layer to make the other three components visually clear.\n\nIf you modify the PSD file, you should see your changes as soon as you\nexport.\n\nCustomize the canonical face mesh\n---------------------------------\n\nIf models and textures are being created using the\n`assets/canonical_face_mesh.fbx` included in the SDK, these settings are also\nrequired when exporting FBX files:\n\n- Make sure the any custom meshes are skinned to the associated bones or regions.\n\n- Use the following hierarchy:\n\n ```\n asset\n |__root\n | |__NOSE_TIP\n | |__FOREHEAD_RIGHT\n | |__FOREHEAD_LEFT\n |__facemesh \u003c-- for reference\n |__ \u003c-- place additional custom 3D meshes here\n ```\n- Do not export the included `facemesh` model. This mesh is for reference only.\n ARCore will create a separate face mesh at runtime. Use the UVs in `facemesh`\n as a reference when creating custom face mesh textures.\n\n- Place custom meshes as children of the `asset` node.\n\n- Use of namespaces is supported.\n\n- The asset contains four bones consisting of `root` and `NOSE_TIP`,\n `FOREHEAD_RIGHT`, and `FOREHEAD_LEFT` regions. Do not change the names of\n these bones."]]