The sample seems to be using api that's being deprecated.

https://developer.apple.com/documentation/compositorservices/drawing_fully_immersive_content_using_metal

I'm following this doc to use metal in vision os. I noticed that the tangent is being deprecated which is being used in the sample

https://developer.apple.com/documentation/compositorservices/layerrenderer/drawable/view

will the sample code be updated?

Hi @DaeLee

Thanks for bringing this to our attention. To clarify, the article uses the deprecated method, but the sample code does not. The updated sample code uses computeProjection(convention:viewIndex:). Here's the relevant snippet.

func createUniforms(forViewIndex viewIndex: Int) -> UniformsPerView {
    let view = drawable.views[viewIndex]
    let viewMatrix = (simdDeviceAnchor * view.transform).inverse
    let projection = drawable.computeProjection(convention: .rightUpBack,
                                                viewIndex: viewIndex)
    
    return UniformsPerView(modelViewProjectionMatrix: projection * viewMatrix)
}
The sample seems to be using api that's being deprecated.
 
 
Q