Can I use a height map with SceneKit? Is there a function or api that I can use to achieve that?
I would like to make a game and it would really help me.
Can I use a height map with SceneKit? Is there a function or api that I can use to achieve that?
I would like to make a game and it would really help me.
I've created a custom Core Image filter that will convert your height/bump map to a normal map that you can use with SceneKit materials. You can read about it and download a sample implementation at my blog.
In a nutshell, a normal map includes displacement data for x, y and z axes mapped to red, green and blue. My filter looks at the horizontal and vertical slopes of each pixel in a monochrome bump map and outputs the red and green colors based on those. The blue and alpha channels are always set to 1.
This filter can be used with procedural sources (such as gradients) or existing images.
No way that I know of, but here is a handy converter for making normal maps out of height maps. It seems to require you to check "invert height" to work properly, but otherwise the default values work for me.
It'd be nice to be able to use height maps in SceneKit, but this is the next best thing.