i'm using mediapipe aar in android and using opengl to fill the color in particular landmarks (lips).
Problem is its not looking realistic or some good looking.
as of my analysis, TextureFrame applying in the GLSurfaceView with vertex and Fragment shader, and whatever I'm applying polygons(Triangles) in another program(vertex and fragment)
- I tried to use mix in fragment shader - not worked.(because camera texture frame in another program(vertex and fragment shader), and the color apply in particular coordinates is in another program)
How can i get the particular pixel(texture or texel) and apply the color mix to achieve some realistic thing.? or is any other approaches there?
Update : I'm using Solutions API from Mediapipe I'm changing the this FaceMeshResultGlRenderer.java Renderer file to do polygons works.
changed drawLandmarks function as below,
val vertex: FloatArray = FloatArray(connections.size * 4) //connections are array list for my facemesh landmarks in triangle.
var lastAddedIndex = 0
for (i in 0 until connections.size) {
val starts: LandmarkProto.NormalizedLandmark = faceLandmarkList[connections[i].start]
val ends: LandmarkProto.NormalizedLandmark = faceLandmarkList[connections[i].end]
vertex[lastAddedIndex++] = starts.x
vertex[lastAddedIndex++] = starts.y
vertex[lastAddedIndex++] = ends.x
vertex[lastAddedIndex++] = ends.y
}
val vertexBuffer = ByteBuffer.allocateDirect(vertex.size * 4)
.order(ByteOrder.nativeOrder())
.asFloatBuffer()
.put(vertex)
vertexBuffer.position(0)
GLES20.glEnableVertexAttribArray(positionHandle)
GLES20.glVertexAttribPointer(positionHandle, 2, GLES20.GL_FLOAT, false, 0, vertexBuffer)
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_FAN, 0, (vertex.size / 2))
and my fragment shader and rest of the code is same in above FaceMeshResultGlRenderer.java file
