Hey! I'm back. I created the repo here: https://github.com/armthethinker/AssetCatalogRealityKit-PossibleBug. There are some notes in the readme that describe the app a bit more. While prepping this, I think the visual error is coming from how the asset catalog is handling the normal map. Hope this helps you all – and I hope that you all can provide a bit of guidance in the future about the best ways to store textures for RealityKit in Xcode.
Post
Replies
Boosts
Views
Activity
1/3. The plane with the gold and black tiling is what I'm focused on. (The content in the middle is a reprojected depth video and can be ignored for my question.) The first image shows what appears to be the right application of the PBR textures to the PBR material to the ground mesh square. The other two images show what happened when I loaded the same textures from the asset catalog. There's also an hdr environment texture for the lighting.
2. Nothing special. I do var material = PhysicallyBasedMaterial(). I load each texture (albedo, ao, normal, metalness, and roughness) with TextureResource.load(named:), passing in the string of the texture name. Then, for each texture, I apply it to the material with the appropriate parameter (e.g. material.baseColor = PhysicallyBasedMaterial.BaseColor(texture: albedo)). Then, I apply the material to my mesh with ModelEntity(mesh: mesh, materials: [material]). This technique was the same for both loading from an included folder in my app bundle and when I was loading it from the asset catalog.
4. I tried different combinations of the "Render As" setting and "Compression" setting, but never got the right look. I don't remember the settings exactly as I've since stripped the asset catalog out of my project.
I'll try to get you all a sample project over the weekend.
Sweet! That works. Thanks!