การสร้างพื้นผิวที่กําหนดเองและโมเดล 3 มิติสําหรับ Augmented Faces
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หากต้องการใช้ Augmented Faces คุณต้องมีพื้นผิวและโมเดลที่ปรับแต่งมาสําหรับการวางซ้อนใน Mesh Mesh ที่ระบุ เนื้อหาเหล่านี้สร้างขึ้นโดยศิลปินล่วงหน้าในซอฟต์แวร์โมเดลและแอนิเมชัน 3 มิติ และส่งออกเป็นไฟล์ *.fbx
Sceneform SDK สําหรับ Android จะจัดส่งไฟล์ canonical_face_mesh.fbx
และไฟล์ canonical_face_mesh.psd
เพื่อช่วยให้ศิลปินสร้างเนื้อหาที่วางซ้อนอย่างถูกต้องบนใบหน้าที่ ARCore ตรวจพบ ไฟล์เหล่านี้จะอยู่ในโฟลเดอร์ assets
การใช้ไฟล์ *.fbx
เพื่อสร้างเนื้อหา
ไฟล์ *.fbx
มีโทโพโลยีแบบตาข่าย พิกัดพื้นผิว UV และ Rig ที่ระบุพื้นที่บนใบหน้าที่รองรับซึ่งสร้างขึ้นและแนบเนื้อหา หากต้องการให้ไฟล์เข้ากันได้กับ ARCore ให้บันทึกไฟล์ *.fbx
รายการโดยใช้การตั้งค่าที่รองรับ จากนั้นคุณจะนําเข้าไฟล์เหล่านี้เข้าสู่โปรเจ็กต์ *.sfb
ไฟล์ได้
ไฟล์นี้มีการอ้างอิง facemesh
ที่ไม่ควรส่งออกเป็นส่วนหนึ่งของ *.fbx
สุดท้าย ARCore จะสร้างและอัปเดต Mesh ที่แยกจากกันขณะรันไทม์
การใช้ไฟล์ *.psd
เพื่อสร้างเนื้อหา
ระบบจะใช้พื้นผิวอ้างอิง Mesh ของ .psd
เพื่อดูพื้นผิวที่ศิลปินสร้างเข้ากับลักษณะใบหน้าของผู้ใช้ขณะรันไทม์ ซึ่งประกอบด้วย
4 ชั้น ได้แก่
- มาสก์: แสดงตําแหน่งของตา รูจมูก และปากในพื้นผิว
- บรรทัด: หลักเกณฑ์ที่แสดงลักษณะใบหน้าของผู้ใช้แสดงอยู่ในลักษณะพื้นผิวระหว่างรันไทม์
- UV: แสดงสามเหลี่ยมรูปตาข่ายที่มีพื้นผิว 468 จุด
- พื้นหลัง: เลเยอร์พื้นหลังสีเทาปานกลางซึ่งจะทําให้องค์ประกอบทั้ง 3 ส่วนชัดเจนยิ่งขึ้น
![]()
หากแก้ไขไฟล์ *.psd
คุณจะเห็นการเปลี่ยนแปลงทันทีที่ส่งออก
เราขอแนะนําให้และรองรับการตั้งค่าต่อไปนี้สําหรับไฟล์ *.fbx
ที่ส่งออกจากซอฟต์แวร์การสร้างแบบจําลองและแอนิเมชัน
รูปแบบไฟล์: FBX 2016/2017 หรือใหม่กว่า
การแปลงแกน: แกนบนคือ Y
ปัจจัยที่มีผลต่อขนาด: เซนติเมตร
การตั้งค่าเรขาคณิตที่จําเป็น:
- กลุ่มสมูทตี้
- ตาข่ายเรียบ
- เนื้อหาอ้างอิง
การตั้งค่าเรขาคณิตที่แนะนํา:
- แทนเจนต์และสิ่งผิดปกติ
- สามเหลี่ยม
- ย่านชานเมือง
ภาพเคลื่อนไหว: เปิดใช้
การตั้งค่าโมเดลที่เปลี่ยนรูปแบบแล้ว
- โมเดลที่มีรูปทรงไม่ถูกต้อง
- สกิน
การปรับแต่งตาข่ายหน้า Canonical
หากมีการสร้างโมเดลและพื้นผิวโดยใช้ assets/canonical_face_mesh.fbx
ที่รวมอยู่ใน SDK การตั้งค่าเหล่านี้จําเป็นเช่นกันเมื่อส่งออก *.fbx
ไฟล์
ตรวจสอบว่า Mesh แบบกําหนดเองได้รับการฝึกฝนกับกระดูกหรือภูมิภาคที่เกี่ยวข้อง
ใช้ลําดับชั้นต่อไปนี้
asset
|__root
| |__NOSE_TIP
| |__FOREHEAD_RIGHT
| |__FOREHEAD_LEFT
|__facemesh <-- for reference
|__ <-- place additional custom 3D meshes here
อย่าส่งออกรูปแบบ facemesh
ที่ให้มา Mesh นี้ใช้สําหรับอ้างอิงเท่านั้น
ARCore จะสร้าง Mesh ที่แยกออกจากกันในระหว่างรันไทม์ ใช้ UV ใน facemesh
เป็นข้อมูลอ้างอิงเมื่อสร้างพื้นผิวตาข่ายที่กําหนดเอง
วาง Mesh ที่กําหนดเองเป็นโหนดย่อยของ asset
รองรับการใช้เนมสเปซ
เนื้อหามีกระดูก 4 ชิ้นที่ประกอบด้วยภูมิภาค root
และ 3 ภูมิภาค ได้แก่ NOSE_TIP
, FOREHEAD_RIGHT
และ FOREHEAD_LEFT
อย่าเปลี่ยนชื่อกระดูกเหล่านี้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2022-09-26 UTC
[null,null,["อัปเดตล่าสุด 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."]]