How do I use an asset catalog with RealityKit textures?

Context: I have a .nonAR RealityKit scene with a grounding plane. The plane uses a PhysicallyBasedMaterial and loads/applies the textures when the scene starts.

Problem: I'm getting wildly different visual results depending on if I load from a folder in my app bundle or an asset catalog. And, when loading from an asset catalog, my frame rate drops 50% or more.

Question: Should I be using a catalog for RealityKit textures or should I just add them to my project directly? If I should be using an asset catalog, what settings should I apply to the textures for proper rendering?

Rendering samples:

Loading from files I added directly to the project, which gives the most correct looking render ➡️

Loading from an asset catalog with different compression settings ➡️

Answered by Graphics and Games Engineer in 704315022

Hi, we would like to investigate this further, but need some clarification

  1. Which element of the screenshots is the grounding plane?
  2. How exactly the textures are loaded and the PhysicallyBasedMaterial is created?
  3. Why the first screenshot is “most correct” (it looks like there are big alpha’d-out holes)?
  4. What settings are used in Xcode when setting up the asset catalog?

If you are able to give us a sample project that reproduces this issue, that would help us with debugging. You can either upload the project to GitHub/etc and link it here, or file a bug report on feedback assistant with the project attached.

Accepted Answer

Hi, we would like to investigate this further, but need some clarification

  1. Which element of the screenshots is the grounding plane?
  2. How exactly the textures are loaded and the PhysicallyBasedMaterial is created?
  3. Why the first screenshot is “most correct” (it looks like there are big alpha’d-out holes)?
  4. What settings are used in Xcode when setting up the asset catalog?

If you are able to give us a sample project that reproduces this issue, that would help us with debugging. You can either upload the project to GitHub/etc and link it here, or file a bug report on feedback assistant with the project attached.

How do I use an asset catalog with RealityKit textures?
 
 
Q