SCNMaterial's .displacement property not working

The "What's New in SceneKit" presentation from WWDC 2017 shows how to set material.displacement.contents to a height map PNG in order to make a plane reflect the elevation profile of a volcano. I haven't been able to reproduce the desired effect, so I'm wondering if iOS 11.0 doesn't support it yet.


Has anyone had better luck?


material.displacement.contents = "volcano-height-map.png"
material.displacement.textureComponents = .red


https://developer.apple.com/documentation/scenekit/scnmaterial/2867516-displacement

Accepted Reply

It's working now! It definitely works with Xcode 9 beta 6 but I think beta 5 fixed it. Very cool.

Replies

No luck here. I am experiencing the same issue on Xcode 9 beta 4 and iOS 11 beta 4.

It's working now! It definitely works with Xcode 9 beta 6 but I think beta 5 fixed it. Very cool.

It's working for me but I have a lot of artifacts showing on the displaced mesh. Lots of blocky pixel shadows. Is there something else I need to do in the shader pipeline to have the shadows smoother?

wayoutwest I am making no progress with you the only person on the planet reporting any success. Can you share your code?