为增强面创建自定义纹理和 3D 模型
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需实现增强面,您需要自定义纹理和模型,以便在识别出的人脸网格上叠加。这些素材资源由艺术家在 3D 建模和动画软件中提前创建,并导出为 *.fbx
文件。
Sceneform SDK for Android 附带 canonical_face_mesh.fbx
文件和 canonical_face_mesh.psd
文件,可帮助音乐人创建将正确覆盖到 ARCore 检测到的人脸的资产。这些文件位于 assets
文件夹中。
使用 *.fbx
文件创建素材资源
*.fbx
文件包含人脸网格拓扑、UV 纹理坐标以及用于定义创建和附加素材资源支持的面部区域的装置。为了确保这些文件与 ARCore 兼容,应使用支持的设置保存 *.fbx
文件。然后,您可以将这些文件作为 *.sfb
文件导入项目中。
此文件包含不应在最终 *.fbx
中导出的参考 facemesh
。ARCore 会在运行时生成和更新单独的人脸网格。
使用 *.psd
文件创建素材资源
.psd
人脸网格参考纹理用于查看音乐人在运行时如何打造与用户面部特征对应的纹理。它包括四个层:
- 遮罩:显示眼睛、鼻孔和嘴巴在纹理中的位置。
- 线条:显示用户面部特征如何在运行时与纹理对齐的准则。
- UV:表示 468 点人脸纹理网格的三角测量。
- 背景:中性灰色背景层,使其他三个组件在视觉上清晰可见。
![]()
如果您修改了 *.psd
文件,应在导出后立即看到所做的更改。
对于从建模和动画软件导出的 *.fbx
文件,我们建议并支持以下设置。
自定义规范面网格
如果使用 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
。请勿更改这些架构。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-09-26。
[null,null,["最后更新时间 (UTC):2022-09-26。"],[[["\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."]]