guc icon indicating copy to clipboard operation
guc copied to clipboard

SceneKit issues on iOS

Open lanxinger opened this issue 1 year ago • 6 comments

Just wanted you to also be aware that currently the output doesn't render properly with the latest SceneKit framework on iOS/iPadOS and VisionOS.

It is displaying correctly everywhere else other than SceneKit.

I have reported this to Apple under FB15101924. So far no response on the ticket but it continues to be a problem on iOS 18.1 beta 6.

SceneKit Render: Screenshot 2024-09-11 at 14 27 15

Preview: Preview

RealityView (which is a new swiftUI based renderer) inside Xcode: RealityView_Xcode

Xcode import: Xcode_Import

usdchecker: usdchecker

Modelfile (rename to .usdz since it's not allowed on github): model.zip

lanxinger avatar Oct 09 '24 13:10 lanxinger

Thanks for the report!

pablode avatar Oct 19 '24 11:10 pablode

@pablode So it seems that there is a metallic map getting assigned during the conversion.

I opened the model with Reality Convert on macOS and you can see the metallic slot being assigned with the roughness map.

Screenshot 2024-12-16 at 11 12 27

I am not sure if this assigment is intended or a mistake during the conversion process as there was no metalness property defined in the source gltf model.

Screenshot 2024-12-16 at 11 14 18

lanxinger avatar Dec 16 '24 10:12 lanxinger

Interesting. Going to do a code review. Can you provide me with the source glTF file?

pablode avatar Dec 30 '24 10:12 pablode

Thank you @pablode

here is the .glb zipped up since github doesn't accept it directly: link.zip

I see in blender the model does have a metallic map assigned but the factor is set to 0 rendering it non metallic:

image

lanxinger avatar Dec 30 '24 11:12 lanxinger

According to the glTF spec, the metallic factor is multiplied with the texture values. This is done in UsdPreviewSurface using the UsdUVTexture scale input. It seems SceneKit just ignores this input. This is why the other renderers work.

Screenshot 2024-12-30 at 16 09 58

I guess one optimization would be to drop the texture. However, I think this should be done by in advance by gltf-transform rather than in the converter.

pablode avatar Dec 30 '24 15:12 pablode

thank you @pablode . Yes I think the easiest would be to write a small script for gltf-transform and remove the metallic texture node entirely before running the conversion with guc. Appreciate all the help on this!

lanxinger avatar Dec 31 '24 07:12 lanxinger