Hello, I’d like to ‘transform’ my face with ARKit, SceneKit and TrueDepth camera.
One example is here : https://twitter.com/yt/status/1078534130416013312
To implement this, two images (Y and CbCr) are sent to a Metal shader, and they are converted to RGB in the shader as next document says.
Displaying an AR Experience with Metal | Apple Developer Documentation
But the face drawn by my shader becomes a little bit whiter than other (See the example video).
I set some SCNLightingModel to face’s SCNMaterial object, but this did not work.
The conversion from YCbCr to RGB is not enough? Do I need to do something more?
Thanks in advance.
I changed the view to be drawn from ARSCNView to MTKView (MetalKit).
So I had to write much more code for pipeline, buffers, render encoder …
Then the image became what I expected!
Both fragment shaders are the same, just transform YCbCr to RGB.