SceneKit: understanding how to set scale for floor material?

1k Views Asked by At

Can anyone explain how the two Scale properties work in the Material Inspector of the Xcode Scene Editor?

enter image description here

Ostensibly, it seems the first represents scale along the X-axis while the second represents scale along the Y-axis. There is no discussion of the scale property in the SCNMaterial class.

This image is from the WWDC fox demo. It's used for the floor's diffuse material. Its dimensions are 512x512.

enter image description here

However, the demo uses scale values of 1 for this image. For another floor material image (also 512x512), it uses scale values of 128.

Instead of 1 and 128 shouldn't it use values of 2 or 3 to account for higher device resolutions (e.g., 2x on 5s devices)?

Playing around with different values yields unexpected results. The higher scale value (i.e., 256) yielded a sharper floor, but it also created "horseshoe" artifacts not seen at the 64 level. Also, why isn't a scale factor of 2 or 3 be sufficient?

Accounting for a 2x resolution on iPhone 5s devices, both scale properties were set to 256. That yields: enter image description here

Scale properties set to 128: enter image description here

Scale properties set to 64: enter image description here

Could someone kindly explain how to set the scale properties based on the material's image resolution?

0

There are 0 best solutions below