- Sceneform SDK cho Android có nguồn mở và được lưu trữ (github.com/google-ar/sceneform-android-sdk) với phiên bản 1.16.0.
- Trang web này (developers.google.com/sceneform) đóng vai trò là kho lưu trữ tài liệu cho phiên bản trước, Sceneform SDK for Android 1.15.0.
- Không sử dụng phiên bản 1.17.0 của Cấu phần phần mềm Maven của Sceneform.
- Có thể sử dụng các cấu phần phần mềm Maven 1.17.1. Tuy nhiên, khác với phiên bản, các cấu phần phần mềm 1.17.1 giống với các cấu phần phần mềm 1.15.0.
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 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ủ trên các lưới khuôn mặt đã xác định. Các tài sản này do các nghệ sĩ tạo trước
trong phần mềm tạo mô hình và hoạt ảnh 3D và được xuất dưới dạng tệp *.fbx
.
SDK Cảnh báo cho Android đi kèm với tệp canonical_face_mesh.fbx
và tệp
canonical_face_mesh.psd
để giúp nghệ sĩ tạo nội dung sẽ phủ lên đúng cách
cho các khuôn mặt được ARCore phát hiện. Bạn có thể tìm thấy các tệp này trong thư mục
assets
.
Sử dụng tệp *.fbx
để tạo thành phần
Tệp *.fbx
chứa cấu trúc liên kết lưới khuôn mặt, toạ độ kết cấu UV và khung hình xác định vùng trên khuôn mặt được hỗ trợ để tạo và đính kèm thành phần. Để đảm bảo rằng các tệp này tương thích với ARCore,các tệp *.fbx
phải được lưu bằng cài đặt được hỗ trợ. Sau đó, bạn có thể nhập các tệp này vào
dự án dưới dạng tệp *.sfb
.
Tệp này chứa một tệp đối chiếu facemesh
không được xuất trong *.fbx
. 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.
Sử dụng tệp *.psd
để tạo thành phần
Kết cấu tham chiếu lưới mặt .psd
được dùng để xem cách hoạ tiết mà nghệ sĩ tạo ra các đường thẳng 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. Báo cáo này bao gồm 4 lớp:
- Mặt nạ: Cho thấy vị trí của mắt, lỗ mũi và miệng trong hoạ tiết.
- Dòng: Nguyên tắc cho thấy cách các đặc điểm trên khuôn mặt của người dùng khớp với hoạ tiết trong thời gian chạy.
- UV: Thể hiện tam giác của lưới hoạ tiết khuôn mặt 468 điểm.
- Nền: Một lớp nền xám trung tính để làm cho ba thành phần còn lại rõ ràng.
![]()
Nếu sửa đổi tệp *.psd
, bạn sẽ thấy các thay đổi ngay khi xuất.
Bạn nên và hỗ trợ các chế độ cài đặt sau đây cho các tệp *.fbx
được xuất từ phần mềm tạo mô hình và phần mềm ảnh động.
Định dạng tệp: FBX 2016/2017 trở lên
Chuyển đổi trục: Trục lên là Y
Hệ số tỷ lệ: Centimet
Cài đặt hình học bắt buộc:
- Nhóm làm mượt
- Lưới trơn
- Nội dung tài sản được tham chiếu
Cài đặt hình học đề xuất:
- Tiếp tuyến và điểm bất thường
- Tam giác
- NURBS
Ảnh động: đã bật
Tùy chọn cài đặt mô hình bị biến dạng:
- Mô hình bị biến dạng
- Trang phục
Tùy chỉnh lưới khuôn mặt chính tắc
Nếu bạn tạo các mô hình và hoạ tiết bằng cách sử dụng
assets/canonical_face_mesh.fbx
có trong SDK, thì các chế độ cài đặt này cũng bắt buộc
khi xuất tệp *.fbx
:
Hãy đảm bảo rằng tất cả các lưới tùy chỉnh đều được giao diện với các xương hoặc khu vực liên kết.
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ỉ mang tính chất 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 tệp tham chiếu khi tạo hoạ tiết lưới mặt tùy chỉnh.
Đặt lưới tuỳ chỉnh làm phần tử con của nút asset
.
Chúng tôi hỗ trợ việc sử dụng vùng chứa tên.
Tài sản này có 4 xương gồm root
và 3 vùng: NOSE_TIP
, FOREHEAD_RIGHT
và FOREHEAD_LEFT
. Không được đổ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: 2022-09-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2022-09-26 UTC."],[[["\u003cp\u003eAugmented Faces in ARCore uses custom 3D models and textures (\u003ccode\u003e.fbx\u003c/code\u003e files) overlaid on detected faces.\u003c/p\u003e\n"],["\u003cp\u003eARCore provides a \u003ccode\u003ecanonical_face_mesh.fbx\u003c/code\u003e and \u003ccode\u003ecanonical_face_mesh.psd\u003c/code\u003e file to aid in creating these custom assets.\u003c/p\u003e\n"],["\u003cp\u003eArtists should use the provided \u003ccode\u003e.psd\u003c/code\u003e file as a guide to align textures with facial features and understand UV mapping.\u003c/p\u003e\n"],["\u003cp\u003eExported \u003ccode\u003e.fbx\u003c/code\u003e files should adhere to specific settings, including FBX format, axis, scale, and geometry settings, for compatibility with ARCore.\u003c/p\u003e\n"],["\u003cp\u003eCustom meshes should be skinned to designated bones (\u003ccode\u003eNOSE_TIP\u003c/code\u003e, \u003ccode\u003eFOREHEAD_RIGHT\u003c/code\u003e, \u003ccode\u003eFOREHEAD_LEFT\u003c/code\u003e) and organized under the 'asset' node in the hierarchy.\u003c/p\u003e\n"]]],["Artists create `*.fbx` files for face overlays using 3D software, utilizing the provided `canonical_face_mesh.fbx` and `canonical_face_mesh.psd` files as references. The `*.fbx` contains face mesh data, while the `*.psd` helps align textures with facial features. When exporting `*.fbx`, specific settings (e.g., FBX 2016/2017 format, Y-axis up) and a defined hierarchy with `root`, `NOSE_TIP`, `FOREHEAD_RIGHT`, and `FOREHEAD_LEFT` are required. Custom meshes should be children of the `asset` node. The facemesh model provided is a reference and should not be exported.\n"],null,["# Creating 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\nThe Sceneform SDK for Android ships 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` folder.\n\nUsing the `*.fbx` file to create assets\n---------------------------------------\n\nThe `*.fbx` file contains the face mesh topology, UV texture coordinates, and\nrig that define 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. You can then import these files into your\nproject as `*.sfb` files.\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\nUsing the `*.psd` file to create assets\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\nFBX asset format and requirements\n---------------------------------\n\nWe recommend and support the following settings for `*.fbx` files exported from\nmodeling and animation software.\n\n- File format: FBX 2016/2017 or later\n\n- Axis conversion: Up axis is Y\n\n- Scale factor: Centimeters\n\n- Required geometry settings:\n\n - Smoothing groups\n - Smooth mesh\n - Referenced asset content\n- Recommended geometry settings:\n\n - Tangents and binormals\n - Triangulate\n - NURBS\n- Animation: enabled\n\n- Deformed models settings:\n\n - Deformed models\n - Skins\n\n### Customizing the canonical face mesh\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 three regions:\n `NOSE_TIP`, `FOREHEAD_RIGHT`, and `FOREHEAD_LEFT`. Do not change the names\n of these bones."]]