This project demonstrates how to create volumetric effects from map data using a Metal shader with SCNProgram. It's a companion to this post about volumetric weather.
The example uses the most recent data from Real Earth to render volumetric clouds over San Francisco.
Install the Mapbox SceneKit using Carthage:
-
Clone this repo.
-
Run
carthage update --platform iOS
to build the iOS dependencies. -
Follow instructions 3-5 of Carthage’s iOS integration instructions. Your application target’s Embedded Frameworks should include MapboxSceneKit.framework and MapboxMobileEvents.framework.
-
Add your access token to the
MGLMapboxAccessToken
field in info.plist.
-
Because the sample uses up-to-date satellite imagery, clouds won't appear on clear days or after dark. To view a specific time of day, you can modify the tile request using RealEarth's documentation.
-
The volumetric rendering is done using a Metal shader, and isn't compatible with the iOS simulator. Build to a physical device for the best results.
scenekit-volumetric-weather is licensed under BSD2. If you build something with this code, please mention it in your readme so that others can learn about the resource.