8

I am working with application using scene kit. And eveything is working fine until iOS 10.

I can see 3D model correct but after I updated my device to iOS 11 the colors of the model changed.

-(void)applyColor:(SCNNode*)node{
    NSArray *materials = node.geometry.materials;
    for (SCNMaterial *material in materials) {
        material.diffuse.contents = [UIColor purpalColor];
    }
}

iOS 9 and iOS 10: enter image description here

iOS 11: enter image description here

Naresh
  • 16,698
  • 6
  • 112
  • 113
DeveshM
  • 476
  • 4
  • 11
  • Please can you show some code as to how you are generating these images. – Fogmeister Apr 10 '18 at 15:51
  • @Fogmeister I have added code in my original question. I am not creating any image from it but it's a 3D model and I am applying my custom color. – DeveshM Apr 10 '18 at 16:27
  • This has nothing to do with code. This is a result of the way colors are handled differently in iOS 11. You''ll need @mnuages or someone similarly knowledgeable about SceneKit and iOS to help with this. – Confused Apr 11 '18 at 10:30
  • @Confused thanks for sharing info – DeveshM Apr 13 '18 at 04:03
  • @Confused I have still not able to figure out how to solve this issue. is there any other place I have to check? – DeveshM May 23 '18 at 15:21
  • sorry to hear you are still struggling with this. I have added a bounty, I hope this helps find someone able to help you! – Confused May 23 '18 at 16:43
  • @DeveshM Maybe try also asking about this here: https://forums.developer.apple.com – Confused May 24 '18 at 08:41

2 Answers2

6

According to Apple, the default color is white for meterial.diffuse.contents.

By default, the diffuse property’s contents object is a white color.

Not seeing your code, I do wonder about this line since this appears to be an obvious typo:

[UIColor purpalColor];

Presumably, it builds, so I assume it is a valid name.

Have you been able to verify that the color above is providing the desired value? Since it appears that iOS is expecting something, not getting it, and sending back the default color here.

CodeBender
  • 35,668
  • 12
  • 125
  • 132
  • It doesn't look quite white to me, in the second image, more like a very bright pink. – Confused May 26 '18 at 06:43
  • @Confused I did go over it with color picker, and while it is not pure white, the values tend to align closely with white. The most common value I am seeing is 253,248,255. The G&B values are well out of range for a light pink IMO (color is subjective after all). – CodeBender May 30 '18 at 15:56
  • One thing I would like to add in my question is purpalColor is extension. Actual RGB color is (191,170,213) for but still it shows brighter in Scenekit 3D model. and for iOS 11 it's more brighter and it's changed. Do I need to add anything in my code? – DeveshM Jun 15 '18 at 18:52
-2

Just a thought, try using a non-custom color just to see if that gets you back on track. Possibly a clamping issue iOS 10 Wide Color? Try searching this post: iOS 10 Wide Color: Do I need to be concerned?. It specifically says UIKit and I didn't see anything specific to scenekit but again, just a thought.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Voltan
  • 1,170
  • 1
  • 7
  • 16