如何使用Arcore和Sceneform动态更改2D纹理的颜色

问题描述

我正在使用ARCore和SceneForm开发AR应用程序。我想为嘴唇添加纹理。使用arcore和SceneForm应用嘴唇颜色。是否可以动态更改纹理的颜色,或者我们需要为不同的颜色创建单独的.png文件。 我应该为每种颜色创建单独的R.drawable.makeupforlips文件

Texture.builder()
   .setSource(this,R.drawable.makeupforlips)
   .setUsage(Texture.Usage.COLOR)
   .build()
   .thenAccept(texture -> faceMeshTexture = texture);

addOnUpdateListener:

    for (AugmentedFace face: faceList) {

if (!faceNodeMap.containsKey(face)) {

    AugmentedFaceNode faceNode = new AugmentedFaceNode(face);
    faceNode.setParent(scene);
    // faceNode.setFaceRegionsRenderable(faceRegionsRenderable);
    faceNode.setFaceMeshTexture(faceMeshTexture);
    faceNodeMap.put(face,faceNode);
}

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)