Tạo hoạ tiết tuỳ chỉnh và mô hình 3D cho Khuôn mặt tăng cường
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Để triển khai tính năng Khuôn mặt tăng cường, bạn cần có các hoạ tiết và mô hình tuỳ chỉnh để phủ lên lưới khuôn mặt đã xác định. Các thành phần này được các nghệ sĩ tạo trước trong phần mềm tạo mô hình và ảnh động 3D, sau đó xuất dưới dạng tệp FBX.
Tệp chuẩn
SDK đi kèm với tệp canonical_face_mesh.fbx
và tệp canonical_face_mesh.psd
để giúp nghệ sĩ tạo các thành phần sẽ phủ lên khuôn mặt do ARCore phát hiện một cách chính xác. Bạn có thể tìm thấy các tệp này trong thư mục assets/canonical_face_mesh.fbx
.
Tạo mô hình 3D bằng tệp FBX
Tệp FBX chứa cấu trúc lưới mặt, toạ độ hoạ tiết UV và rig xác định các vùng mặt được hỗ trợ để tạo và đính kèm thành phần. Để đảm bảo các tệp này tương thích với ARCore, bạn nên lưu tệp FBX bằng các chế độ cài đặt được hỗ trợ.
Tệp này chứa một facemesh
tham chiếu không được xuất dưới dạng một phần của FBX cuối cùng. ARCore sẽ tạo và cập nhật một lưới khuôn mặt riêng biệt trong thời gian chạy.
Tạo hoạ tiết 2D bằng tệp PSD
Kết cấu tham chiếu lưới mặt .psd
được dùng để xem cách một kết cấu mà nghệ sĩ tạo ra khớp với các đặc điểm trên khuôn mặt của người dùng trong thời gian chạy. Cấu trúc này bao gồm bốn lớp:
- Mặt nạ: Cho biết vị trí của mắt, lỗ mũi và miệng trong hoạ tiết.
- Đường: Nguyên tắc cho biết cách các đặc điểm trên khuôn mặt của người dùng khớp với một hoạ tiết trong thời gian chạy.
- UV: Biểu thị hình tam giác của lưới kết cấu mặt 468 điểm.
- Nền: Lớp nền màu xám trung tính để làm cho ba thành phần khác rõ ràng về mặt hình ảnh.

Nếu sửa đổi tệp PSD, bạn sẽ thấy các thay đổi ngay khi xuất.
Tuỳ chỉnh lưới mặt chính tắc
Nếu bạn đang tạo mô hình và hoạ tiết bằng assets/canonical_face_mesh.fbx
có trong SDK, thì bạn cũng cần phải sử dụng các chế độ cài đặt này khi xuất tệp FBX:
Đảm bảo mọi lưới tuỳ chỉnh đều được phủ lên các xương hoặc vùng liên kết.
Sử dụng hệ phân cấp sau:
asset
|__root
| |__NOSE_TIP
| |__FOREHEAD_RIGHT
| |__FOREHEAD_LEFT
|__facemesh <-- for reference
|__ <-- place additional custom 3D meshes here
Không xuất mô hình facemesh
đi kèm. Lưới này chỉ dùng để tham khảo.
ARCore sẽ tạo một lưới khuôn mặt riêng biệt trong thời gian chạy. Sử dụng UV trong facemesh
làm tham chiếu khi tạo hoạ tiết lưới mặt tuỳ chỉnh.
Đặt lưới tuỳ chỉnh làm phần tử con của nút asset
.
Hỗ trợ sử dụng không gian tên.
Tài sản này chứa 4 xương bao gồm các vùng root
và NOSE_TIP
, FOREHEAD_RIGHT
và FOREHEAD_LEFT
. Không thay đổi tên của các xương này.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\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."]]