How to show immersive picture behind current window in visionOS?

Following this thread I'm able to render a simple picture in a Plane material, however, I'm unable to scale it to show bigger than the window itself, or move it behind the window.

Here's my relevant code so far.-

var body: some View {
    ZStack {
        RealityView { content in
                    
            var material = UnlitMaterial()
            material.color = try! .init(tint: .white,
                                     texture: .init(.load(named: "image",
                                                             in: nil)))
        
            let entity = Entity()
            let component = ModelComponent(
                mesh: .generatePlane(width: 1, height: 1),
                materials: [material]
            )
            entity.components.set(component)  
          
            let currentTransform = entity.transform
            var newTransform = Transform(scale: currentTransform.scale,
                                         rotation: currentTransform.rotation,
                                         translation: SIMD3(0, 0, -0.2))
            entity.move(to: newTransform, relativeTo: nil)
            
/*                
            let scalingPivot = Entity()
            scalingPivot.position.y = entity.visualBounds(relativeTo: nil).center.y
            scalingPivot.addChild(entity)
            content.add(scalingPivot)          
            scalingPivot.scale *= .init(x: 1, y: 1, z: 1)
*/             
        }
    }
}

It belongs to an ImmersiveSpace I'm opening directly from my main window, but I have several issues:

  • The texture shows always in front of the window
  • I'm unable to scale it (scaling seems to affect to the texture coordinates inside the material instead of scaling the mesh itself)
  • I can only see the texture in the canvas preview (not in simulator)

I have exactly the same question. If I use Model3D it will be rendered "On" the window, but if I use RealityView it is rendered between camera and window. If I want to integrate my elements into the view, it is not possible. Moving Objects Positions is also not possible. So how am I supposed to render 3D content to a swiftUI Window but still have access to change materials (e.g. to show materials in different colors) ?

How to show immersive picture behind current window in visionOS?
 
 
Q