HomeiOS Developmentios - RealityKit and Actuality Composer Professional: Customized Shader Materials

ios – RealityKit and Actuality Composer Professional: Customized Shader Materials


I’ve a number of questions on utilizing RealityKit on iPadOS and Mac Catalyst.

I at the moment have a mannequin in Cinema 4D that has no supplies added to it. I would like so as to add a few easy supplies to every little thing.

My aim is to maneuver my mannequin from Cinema 4D to my RealityKit app. The mannequin can load wonderful within the app. Nevertheless, I am having points with the supplies.

First, after I export from Cinema 4D as a USD, the supplies do not appear to come back with it. I believed supplies got here with the mannequin. I simply get a pink striped mannequin (no supplies), which isn’t best. So, that crossed out making supplies in Cinema 4D for me.

This is a take a look at mannequin with supplies added:

A screenshot of Cinema 4D with a scene that has materials applied to it.

This is what it appears like when exported as a USDA in Actuality Composer Professional. It appears the identical when exported as a USDZ:

A screenshot of a model in Reality Composer Pro without any materials.

I checked supplies when exporting from Cinema 4D, so I do not know what I’m doing flawed. So, I considered one other concept as a substitute of constructing supplies in Cinema 4D.

What if I used Apple’s new Actuality Composer Professional app so as to add supplies to my mannequin? You possibly can add bodily primarily based supplies and even customized shader supplies with nodes.

I believed that will work, and it does. After I export the mannequin as a USDZ with bodily primarily based supplies, they seem wonderful and work in my app.

Nevertheless, what about customized shader supplies?

Every time I play with a customized shader materials and apply it to my mannequin, I’m left with issues.

Take a look at this picture. That is my mannequin in Actuality Composer Professional with two sorts of supplies added from the app. The water and sand on the seashore are created with bodily primarily based supplies within the app. No nodes. The gold/steel ball is created with a customized shader materials with nodes. Appears wonderful, proper?

A screenshot of a model in Reality Composer Pro with two physically based materials in addition to one custom shader material.

After I drag an exported USDZ of this into my Xcode mission, it even appears good within the Xcode preview of the file underneath Sources. (Be aware I’m not including the USDZ as an . rkassets as Apple suggests as .rkassets folders are solely out there for visionOS. That is an iPadOS + Catalyst app.)

Nevertheless, after I run the precise app, solely the bodily primarily based supplies really show accurately:

A screenshot of an iPad Pro simulator from Xcode showing the model without custom shader materials working properly.

Apart from the lighting within the scene, the bodily primarily based supplies look good. Nevertheless, the steel ball that used a customized shader materials? It appears grey.

Why? How can I repair this?

I assure this isn’t an issue with my app or its lighting setup and so forth. I attempted loading a customized shader materials in a visionOS simulator and it labored! However, not for this.

I do know Actuality Composer Professional appears to be very centered on visionOS proper now, however that is nonetheless only a USDZ file. Why aren’t these customized shaders working?

I have been engaged on this downside for at the least 24+ hours, so I’ve tried as a lot as I might think about.

I believed Actuality Composer Professional can be good to do textures in as it will be much less error susceptible when shifting the mannequin over to Xcode, in comparison with shifting supplies from Cinema 4D to Xcode, and I sort of proved that with my second photograph.

For RealityKit on iPadOS + Catalyst, how ought to I be making use of supplies? What am I doing flawed?

P.S. Sure, this can be a nonAR mission with a digital digital camera, which is feasible for RealityKit.

Thanks for the assistance! 🙂

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments