keijiro / FaceMeshBarracuda

Lightweight facial capture package for Unity
Apache License 2.0
482 stars 90 forks source link

How to render the face mesh #15

Closed MolianWH closed 2 years ago

MolianWH commented 2 years ago

Thanks for your great work. I want to make a face texture for the face mesh. I set the this.GetComponent<MeshFilter>().mesh = _resources.faceMeshTemplate; in Visualizer.cs OnPostRender() function. but it not work. By the way, I found the _resources.faceMeshTemplate.Vertices are all zero. So which mesh can set UVs and be shown? I am not very familiar with unity and CG. The above statement may be not very accurate. Could you please provide some ideas for that task? Thanks!

example about what I want to implement image

keijiro commented 2 years ago

I found the _resources.faceMeshTemplate.Vertices are all zero

Because it only contains index data. Vertices are given externally.

I'd recommend reading Visualizer.cs and Visualizer.shader in the FaceLandmarkBarracuda project.

https://github.com/keijiro/FaceLandmarkBarracuda

keijiro commented 2 years ago

Or use this branch. I'm not sure if it still runs (may be broken due to compatibility issues).

https://github.com/keijiro/FaceMeshBarracuda/tree/landmark-detector

MolianWH commented 2 years ago

Thanks. I will try it.