In my VisionPro app, I'm facing a problem with loading USDZ models from a RealityKitBundle package, created using Reality Composer Pro.
It was working fine until I added more models to the package. As I added more models with large textures in the project, the app started to show them with texturing problems.
So, when I load the models from the RealityView using Entity(named:in), the mesh loads correctly, but all black, with no textures, as below:
However, when I load the same USDZ directly from the main bundle, using ModelEntity(named:in), it loads fine.
I know that large textures can cause memory issues, but when talking about one single model, I know that it's not enough to cause a memory overflow in the VisionPro. This USDZ model is about 40MB with something around 800MB of texture memory (from the RealityComposerPro Statistic tab).
I've built experiences in VisionPro with much heavier models, and they do present the same texture issues, but only after there's more than 3 huge models enabled in the Reality scene. But that's not the case. The un-textured model appears right from the beginning, so it seems to me that's not a runtime issue in the device, but rather some issue in the packaging process from RealityComposerPro to XCode to the Device, am I correct?
I'm also using a simple Mac Mini with M2 but only 8MB of RAM. Maybe that's the issue?
As I still want to use RealityComposerPro to build more dev-friendly and interesting applications, I'd really appreciate some guidance here!
Thanks in advance!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Summary
After updating to visionOS 26, we’ve encountered severe transparency rendering issues in RealityKit that did not exist in visionOS 2.6 and earlier.
These regressions affect applications that dynamically control scene opacity (via OpacityComponent).
Our app renders ultra-realistic apartment environments in real time, where users can walk or teleport inside 3D spaces. When the user moves above a speed threshold, we apply a global transparency effect to prevent physical collisions with real-world objects.
Everything worked perfectly in visionOS 2.6 — the problems appeared only after upgrading to 26.
Scene Setup Overview
The environment consists of multiple USDZ models (e.g., architecture, rooms, furniture).
We manage LODs manually for performance (e.g., walls and floors always visible in full-res, while rooms swap between low/high-res versions based on user position and field of view).
Transparency is achieved using OpacityComponent, applied dynamically when the user moves.
Some meshes (e.g., portals to skyboxes, glass windows) use alpha materials
We also use OcclusionMaterials to prevent things to be seen through walls when scene is transparent
Observed Behavior by Scenario
(I can share a video showing the results of each scenario if needed.)
Scenario 1 — Severe Flickering (Root Opacity)
Setup:
OpacityComponent applied to the root entity
NO ModelSortGroupComponent used
Symptoms:
Strong flickering when transparency is active
Triangles within the same mesh render at inconsistent opacity levels
Appears as if per-triangle alpha sorting is broken
Workaround:
Moving the OpacityComponent from the root to each individual USDZ entity removes the per-triangle flicker
Pros:
No conflicts with portals or alpha materials
Scenario 2 — Partially Stable, But Alpha Conflicts
Setup:
OpacityComponent applied per USDZ entity
ModelSortGroupComponent(planarUIAlwaysBehind) applied to portal meshes
Other entities have NO ModelSortGroupComponent
Symptoms:
Frequent alpha blending conflicts:
Transparent surfaces behind other transparent surfaces flicker or disappear
Example: Wine glasses behind glass doors — sometimes neither is rendered, or only one
Even opaque meshes behind glass flicker due to depth buffer confusion
Alpha materials sometimes render portals or the real world behind them, ignoring other geometry entirely
Analysis:
Appears related to internal changes in alpha sorting or depth pre-pass behavior introduced in visionOS 26
Pros:
Most stable setup so far
Cons:
Still unreliable when OpacityComponent is active
Scenario 3 — Layer Separation Attempt (Regression)
Setup:
Same as Scenario 2, but:
Entities with alpha materials moved to separate USDZs
Explicit ModelSortGroupComponent order set (alpha surfaces rendered last)
Symptoms:
Transparent surfaces behind other transparent surfaces flicker or disappear
Depth is completely broken when there's a large transparent surface
Alpha materials sometimes render portals or the real world behind them, ignoring other geometry entirely
Workaround Attempt:
Re-ordering and further separating models did not solve it
Pros:
None — this setup makes transparency unusable
Conclusion
There appears to be a regression in RealityKit’s handling of transparency and sorting in visionOS 26, particularly when:
OpacityComponent is applied dynamically, and
Scenes rely on multiple overlapping transparent materials.
These issues did not exist prior to 26, and the same project (no code changes) behaves correctly on previous versions.
Request
We’d appreciate any insight or confirmation from Apple engineers regarding:
Whether alpha sorting or opacity blending behavior changed in visionOS 26
If there are new recommended practices for combining OpacityComponent with transparent materials
If a bug report already exists for this regression
Thanks in advance!
I'm developing a VisionOS app and I'm trying to load a ModelEntity from a USDZ file which is inside my custom RealityKit package called R2UVisionOficial. But it keeps giving me an resourceNotFound error.
import RealityKit
import R2UVisionOficial
import ARKit
/* more code */
do {
let newEntity: Entity
//...
// Loads entity from USDZ inside package
newEntity = try await ModelEntity(named: "Salas", in: r2UVisionOficialBundle)
//...
return newEntity
} catch {
print("wtManager >>> **** FAILED to load entity:", error.localizedDescription)
throw error
}
I'm sure I have the Salas.usdz file in the root folder of my package and that I'm using the correct paths. However I keep getting the error:
Failed to find resource with name "Salas" in bundle
It's funny because when I try to load a USDA (scenes) from the same packages, it works fine. So I guess there's something to do with ModelEntity or USDZ files.
Can you please help me?
P.S. This issue is similar to https://developer.apple.com/forums/thread/746842?answerId=780415022#780415022
Hi everyone,
I’m encountering a memory overflow issue in my visionOS app and I’d like to confirm if this is expected behavior or if I’m missing something in cleanup.
App Context
The app showcases apartments in real scale using AR.
Apartments are heavy USDZ models (hundreds of thousands of triangles, high-resolution textures).
Users can walk inside the apartments, and performance is good even close to hardware limits.
Flow
The app starts in a full immersive space (RealityView) for selecting the apartment.
When an apartment is selected, a new ImmersiveSpace opens and the apartment scene loads.
The scene includes multiple USDZ models, EnvironmentResources, and dynamic textures for skyboxes.
When the user dismisses the experience, we attempt cleanup:
Nulling out all entity references.
Removing ModelComponents.
Clearing cached textures and skyboxes.
Forcing dictionaries/collections to empty.
Despite this cleanup, memory usage remains very high.
Problem
After dismissing the ImmersiveSpace, memory does not return to baseline.
Check the attached screenshot of the profiling made using Instruments:
Initial state: ~30MB (main menu).
After loading models sequentially: ~3.3GB.
Skybox textures bring it near ~4GB.
After dismissing the experience (at ~01:00 mark): memory only drops slightly (to ~2.66GB).
When loading the second apartment, memory continues to increase until ~5GB, at which point the app crashes due to memory pressure.
The issue is consistently visible under VM: IOSurface in Instruments. No leaks are detected.
So it looks like RealityKit (or lower-level frameworks) keeps caching meshes and textures, and does not free them when RealityView is ended. But for my use case, these resources should be fully released once the ImmersiveSpace is dismissed, since new apartments will load entirely different models and textures.
Cleanup Code Example
Here’s a simplified version of the cleanup I’m doing:
func clearAllRoomEntities() {
for (entityName, entity) in entityFromMarker {
entity.removeFromParent()
if let modelEntity = entity as? ModelEntity {
modelEntity.components.removeAll()
modelEntity.children.forEach { $0.removeFromParent() }
modelEntity.clearTexturesAndMaterials()
}
entityFromMarker[entityName] = nil
removeSkyboxPortals(from: entityName)
}
entityFromMarker.removeAll()
}
extension ModelEntity {
func clearTexturesAndMaterials() {
guard var modelComponent = self.model else { return }
for index in modelComponent.materials.indices {
removeTextures(from: &modelComponent.materials[index])
}
modelComponent.materials.removeAll()
self.model = modelComponent
self.model = nil
}
private func removeTextures(from material: inout any Material) {
if var pbr = material as? PhysicallyBasedMaterial {
pbr.baseColor.texture = nil
pbr.emissiveColor.texture = nil
pbr.metallic.texture = nil
pbr.roughness.texture = nil
pbr.normal.texture = nil
pbr.ambientOcclusion.texture = nil
pbr.clearcoat.texture = nil
material = pbr
} else if var simple = material as? SimpleMaterial {
simple.color.texture = nil
material = simple
}
}
}
Questions
Is this expected RealityKit behavior (textures/meshes cached internally)?
Is there a way to force RealityKit to release GPU resources tied to USDZ models when they’re no longer used?
Should dismissing the ImmersiveSpace automatically free those IOSurfaces, or do I need to handle this differently?
Any guidance, best practices, or confirmation would be hugely appreciated.
Thanks in advance!