title: How can I make SceneView's background transparent?
body: <p>I want to open a 3D model and make its background transparent, so that I can see the UI behind the SceneView. I've tried this code, but sceneView becomes white, not transparent.</p>
  <pre><code>
  struct ModelView: View {
      var body: some View {
          ZStack {
              Text(&quot;Behind Text Behind Text Behind Text&quot;)
              SceneView(
                  scene: { () -&gt; SCNScene in
                      let scene = SCNScene()
                      scene.background.contents = UIColor.clear
                      return scene
                  }(),
                  pointOfView: { () -&gt; SCNNode in
                      let cameraNode = SCNNode()
                      cameraNode.camera = SCNCamera()
                      cameraNode.position = SCNVector3(x: 0, y: 0, z: 10)
                      return cameraNode
                  }(),
                  options: [
                      .allowsCameraControl,
                      .temporalAntialiasingEnabled,
                  ]
              )
          }
      }
  }
  </code></pre>
  <p>I use XCode 12.5 and IPhone 8.</p>
  <p>EDIT 1:</p>
  <p>Thanks to the comments below, I decided to try new approaches but they still don't work.</p>
  <p>Approach #1</p>
  <p>First, I tried to create a MySceneView using SCNView through UIViewRepresentable:</p>
  <pre><code>struct MySceneView: UIViewRepresentable {
      typealias UIViewType = SCNView
      typealias Context = UIViewRepresentableContext&lt;MySceneView&gt;
  
      func updateUIView(_ uiView: UIViewType, context: Context) {}
      func makeUIView(context: Context) -&gt; UIViewType {
          let view = SCNView()
          view.allowsCameraControl = true
          view.isTemporalAntialiasingEnabled = true
          view.autoenablesDefaultLighting = true
          view.scene = MySceneView.scene
          return view
      }
      
      static let scene: SCNScene = {
          let scene = SCNScene(named: &quot;art.scnassets/man.obj&quot;)!
          scene.background.contents = UIColor.clear
          let cameraNode = SCNNode()
          cameraNode.camera = SCNCamera()
          cameraNode.position = SCNVector3(x: 0, y: 0, z: 10)
          scene.rootNode.addChildNode(cameraNode)
          return scene
      }()
  }
  </code></pre>
  <p>Approach #2
  I tried using SpriteView, here is the code:</p>
  <pre><code>        ZStack {
              Text(&quot;Behind Text Behind Text Behind Text&quot;)
              SpriteView(scene: { () -&gt; SKScene in
                  let scene = SKScene()
                  scene.backgroundColor = UIColor.clear
                  let model = SK3DNode(viewportSize: .init(width: 200, height: 200))
                  model.scnScene = MySceneView.scene
                  scene.addChild(model)
                  return scene
              }(), options: [.allowsTransparency])
  }
  </code></pre>