Post

Replies

Boosts

Views

Activity

Reply to Pink Screen with VideoMaterial in ARKit
The following code works on iOS 17 and iPadOS 17.x but not on 18. The Video Plane simply appears pink instead of showing the video itself. import SwiftUI import RealityKit import AVFoundation struct ContentView : View { var body: some View { RealityView { content in // Create a cube model let model = Entity() let mesh = MeshResource.generateBox(size: 0.1, cornerRadius: 0.005) let material = SimpleMaterial(color: .gray, roughness: 0.15, isMetallic: true) model.components.set(ModelComponent(mesh: mesh, materials: [material])) model.position = [0, 0.05, 0] // Create horizontal plane anchor for the content let anchor = AnchorEntity() let player = AVPlayer(url: Bundle.main.url(forResource: "phone-video", withExtension: "mp4")!) let videoMaterial = VideoMaterial(avPlayer: player) let modelEntity = ModelEntity(mesh: .generateBox(width: 2.0, height: 1.7, depth: 0.01), materials: [videoMaterial]) player.play() modelEntity.position.z -= 2 modelEntity.setParent(anchor) anchor.addChild(model) // Add the horizontal plane anchor to the scene content.add(anchor) content.camera = .spatialTracking } .edgesIgnoringSafeArea(.all) } } #Preview { ContentView() }
Topic: Graphics & Games SubTopic: RealityKit Tags:
Apr ’25
Reply to Pink Screen with VideoMaterial in ARKit
It finally works on iOS 18.5 on an iPhone 16e! Does it also work for you, @Dauben ?
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
May ’25
Reply to Pink Screen with VideoMaterial in ARKit
I can confirm it works on iPadOS 18.4.1, but not on iOS 18.4.1
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
May ’25
Reply to Pink Screen with VideoMaterial in ARKit
Still not working on iOS 18.4 and 18.4.1. Anything we can do meanwhile?
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Pink Screen with VideoMaterial in ARKit
The following code works on iOS 17 and iPadOS 17.x but not on 18. The Video Plane simply appears pink instead of showing the video itself. import SwiftUI import RealityKit import AVFoundation struct ContentView : View { var body: some View { RealityView { content in // Create a cube model let model = Entity() let mesh = MeshResource.generateBox(size: 0.1, cornerRadius: 0.005) let material = SimpleMaterial(color: .gray, roughness: 0.15, isMetallic: true) model.components.set(ModelComponent(mesh: mesh, materials: [material])) model.position = [0, 0.05, 0] // Create horizontal plane anchor for the content let anchor = AnchorEntity() let player = AVPlayer(url: Bundle.main.url(forResource: "phone-video", withExtension: "mp4")!) let videoMaterial = VideoMaterial(avPlayer: player) let modelEntity = ModelEntity(mesh: .generateBox(width: 2.0, height: 1.7, depth: 0.01), materials: [videoMaterial]) player.play() modelEntity.position.z -= 2 modelEntity.setParent(anchor) anchor.addChild(model) // Add the horizontal plane anchor to the scene content.add(anchor) content.camera = .spatialTracking } .edgesIgnoringSafeArea(.all) } } #Preview { ContentView() }
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Pink Screen with VideoMaterial in ARKit
And still the same issue on iOS 18.4.0.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Pink Screen with VideoMaterial in ARKit
Same issue on iPadOS 18.3.2. Can we please escalate this issue?
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Pink Screen with VideoMaterial in ARKit
Same issue on iOS 18.3.2
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Mar ’25