为增强面创建自定义纹理和 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 文件,则应该会在导出后立即看到所做的更改。
自定义规范人脸网格
如果模型和纹理是使用
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):2024-10-16。
[null,null,["最后更新时间 (UTC):2024-10-16。"],[[["Augmented Faces uses customized 3D models and 2D textures, created by artists and exported as FBX files, to overlay onto detected faces."],["ARCore provides canonical FBX and PSD files to aid in the creation of these assets, ensuring proper alignment with detected facial features."],["When exporting custom FBX files, ensure proper hierarchy, skinning, and bone naming to maintain compatibility with ARCore's runtime face mesh generation."],["The provided PSD file helps artists align 2D textures with facial features using layers for masks, guidelines, UVs, and background."]]],["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"]]