iOS 17 SceneKit normalmap & morphtarget causes lighting/shading issue

After the iOS 17 update, objects rendered in SceneKit that have both a normal map and morph targets do not render correctly. The shading and lighting appear dark and without reflections. Using a normal map without morph targets or having morph targets on an object without using a normal map works fine. However, the combination of using both breaks the rendering.

Using diffuse, normal map and a morpher:

Diffuse and normal, NO morpher:

Post not yet marked as solved Up vote post of Ginada Down vote post of Ginada
1.4k views

Replies

I have the same issue (even with latest beta 8). Did you find any workaround?

  • ok opened FB13098242 on this.

Add a Comment

Did you make any progress figuring this out? I'm pretty sure a version of this bug existed in iOS 16. In iOS 16 we've had a problem where randomly the normal map seems to become corrupted. After weeks of tracking it down it seemed to be related to 4 things interacting badly: SCNSkinner, SCNMorpher, normal maps and lights which cast shadows. The only "fix" was to remove normal maps or disable all shadow casters. Ultimately, because it was pretty rare we just lived with it.

Now with iOS 17 we see exactly the problem you're describing-- models that have both a normal map and a SCNMorpher will render with what appears to be totally corrupted normals. When I export the scene from our app as a SceneKit scene file, the problem still exists and is visible in the Xcode scene editor. [Here's the scene file for anyone who's curious: (https://drive.google.com/file/d/1XEZqvU1LwkCdvt96MXt3dKSSFtLOPf4-/view?usp=share_link)]

What super interesting is I took Apple's game project template from Xcode 15, and tried adding a normal map and morpher to the spaceship model, and in that project it seems to work. So that gives me hope that there’s still something that can make the combination work.

Are you using any 3rd party libraries to load your models? Do you generate / assemble the model in code?

I got a response from Apple through the feedback assistant that they fixed this in the latest version of iOS 17. I tried it out and it does work.

But there's still issues with models that has a combination of normal map/morpher/skeleton if one of these are taken out of the equation the shader seems to work fine and having all 3 of them breaks it.

I'm not using any 3rd party libraries to load assets I'm also not generate assets in code. Just loading Scenekit files and updating the shaders in code.

  • Indeed the problem still persists, I have reported the problem 3 months ago (FB13201564).

Add a Comment

Did you solve this problem?

This appears to still be broken for some cases, at least on macOS Sonoma 14.1 (23B74). I've filed my own feedback as FB13340109.

  • This seems to have significantly improved as of macOS Sonoma 14.3 Beta (23D5033f).

Add a Comment