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.
Post
Replies
Boosts
Views
Activity
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?
Hi,
i have a SceneKit/ARKit (with my own metal shader) app and I need to change the main texture format from .bgra8unorm_srgb to .bgra8unorm.
Since it is srgb, anything I draw is again converted to srgb and shown too bright.
Is there a way to change it/how can it be changed?
I didn't find anything useful in docs or examples.
Thx
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.