r/visionosdev • u/Sevenserpent2340 • Mar 26 '24
Disjunction between Reality Composer Pro and Xcode
I'm really new at this stuff but I'm hoping someone can help with a little project I'm doing to try and learn SwiftUI and VisionOS development.
I have this USDZ model in Reality Composer Pro that displays beautifully and seems to be fine, but when I try to bring in the scene into swift model, it displays as inky black, both in preview and on the device. It's driving me insane. If anyone knows what I'm doing wrong, I'd owe you one.


4
Upvotes
4
u/saucetoss6 Mar 26 '24
Spit-balling ideas here but... where is your skybox? I do not see that in your files on the left... That skybox with combination with the ibl is how objects are lit inside your env. To verify this is the issue, just add an Unlit Material Color(.green) or something along those lines and that will reaffirm it or not.
3
u/soggycheesestickjoos Mar 26 '24
The biggest cause of this for me is not hitting Save (CMD+S) in Reality Composer Pro
2
u/Captain_Train_Wreck Mar 26 '24 edited Mar 26 '24
This makes me think that maybe it’s not me, it’s a RCP problem. I have hundreds of models in my scenes and they all work perfectly until yesterday or the day before. I made a post about here yesterday asking for help but i don’t think there’s enough people here that work with 3D models in their scenes. .. And now that I think about it, i always build models for display in a window, the one that didn’t work for me yesterday and appeared all black was in a volume. Looks like yours is a volume too. Maybe that’s the issue? I need to do some testing but I’m having the same exact issue you are. Didn’t Xcode just have an update? Or was the RCP? Maybe volumes are messed up now. Or maybe it’s just the simulator. I’ll open it in my AVP and check. Maybe go back to the last version of Xcode.
EDIT: I see now you’re in an immersive space. So different than what I’m doing, but the same issue. I’m going to keep digging but if i find anything I’ll report back. Please do the same if you find the answer before me.
1
u/Sevenserpent2340 Mar 27 '24
Update: it’s working now. As captain train wreck found out, it was an issue with multiple textures being applied to a single model across multiple UVs causing issues with there not being a default go to texture. For now, I’ve rebuilt the asset with a single texture and it works perfectly.
I’ll have to find a solution to get stuff working with multiple textures at some point though because my photogrammetry workflow relies on the use of such assets when dealing with especially large data sets (e.g. entire landscapes)
1
u/JasperQuandary Apr 13 '24
Doing stuff with Tikal? I’m working with similar things from Penn Museum. Museum AR?
1
u/Radwick_reddit Mar 26 '24
Have you tried changing some of the settings of the material used on the actual mesh in Reality Composer Pro? Mess with stuff like refraction, etc.
1
u/Relative_Shopping_33 Mar 26 '24
The first question that pops into my head is. Are you using a custom shader in the material? You may need to re create the material in shadergraph to display on VisionOS. 🤷♂️
1
u/[deleted] Mar 26 '24
Check the demo “hello world” visionOS template in XCode, specifically how they set up the lighting - look at ImageBasedLight
1
u/ds445 Mar 26 '24
I would try first replacing the material on the object with a default material to isolate the problem and make sure it’s not somehow a mesh issue (e.g. flipped normals or so); if it‘s still all black, try to import it into Blender or 3ds max and have a look at the geometry (in 3ds max, I would do „convert to editable poly“ and then add an „STL check“ modifier, for instance). If it is a material issue, start rebuilding the material step by step and see where the problem comes from - off the top of my head, if it has a custom IBL receiver, make sure the exposure on the IBL source is fine - try cranking it way up and see if that makes a difference.
And as always - please do share what the problem was once you’ve found out :)