Post

Replies

Boosts

Views

Activity

ARKit video YCbCr -> RGB conversion matrix
Hi all, though I have the YCbCr texture of the camera feed, I still lack the right matrix to convert it to what ARKit is showing as background texture. I tried it with this matrix (found here): constant const float4x4 ycbcrToRGBTransform = float4x4(     float4(+1.0000f, +1.0000f, +1.0000f, +0.0000f),     float4(+0.0000f, -0.3441f, +1.7720f, +0.0000f),     float4(+1.4020f, -0.7141f, +0.0000f, +0.0000f),     float4(-0.7010f, +0.5291f, -0.8860f, +1.0000f) ); But this one is too bright. Are there docs about this or is the background_video_frag source available? (Xcode tells me it's not/needs to be loaded, but I don't know from where) I tried to find out from the buffers used in background_video_frag, but without the source it's hard to tell what's what.
5
0
1.1k
Oct ’21
How to load MTLTexture without premultiplied alpha?
Hello all, I need my texture to be not premultiplied alpha, because is use the alpha for some additional calculations in the fragment shader. At the moment I load my texture like this let textureLoader = MTKTextureLoader(device: sceneView.device!) myTexture = try textureLoader.newTexture(URL: URL(fileURLWithPath: path!), options: [MTKTextureLoader.Option.SRGB: false]) because I need the raw RGBA values. But of course it gets premultiplied. How can I turn off this behavior?
3
0
1.1k
Oct ’21
Properly take a screenshot of a SwiftUI/ARKit IOS app?
I tried several methods already. The last one did let me actually make a screenshots, but then SwiftUI seems to confuse itself and stops showing me the AR video capture and my other SceneNodes. Just white. Toolbar and other SwiftUI stuff is still showing as intended. So here is my question: What is the proper way to take a screenshot of a running ARKit session in SwiftUI? Keep in mind, I don't need the captured video image, I know how to extract that.
0
0
454
Nov ’21