iOS Development

ios – RealityKit and Actuality Composer Professional: Customized Shader Materials

Spread the love

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

I at present 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 the whole lot.

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

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

Here is a check mannequin with supplies added:

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

Here 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 unsuitable. So, I considered one other concept as an alternative of creating supplies in Cinema 4D.

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

I believed that might work, and it does. After I export the mannequin as a USDZ with bodily primarily based supplies, they seem effective 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.

Have a look at this picture. That is my mannequin in Actuality Composer Professional with two varieties 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/metallic ball is created with a customized shader materials with nodes. Seems effective, 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 venture, it even appears good within the Xcode preview of the file underneath Assets. (Notice 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, once I run the precise app, solely the bodily primarily based supplies truly 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 metallic 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 drawback for not less than 24+ hours, so I’ve tried as a lot as I may think about.

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

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

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

Thanks for the assistance! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *