SceneKit: What's New
Description: SceneKit is a fast and fully featured high-level 3D graphics framework that enables your apps and games to create immersive scenes and effects. See the latest advances in camera control and effects for simulating real camera optics including bokeh and motion blur. Learn about surface subdivision and tessellation to create smooth-looking surfaces right on the GPU starting from a coarser mesh. Check out new integration with ARKit and workflow improvements enabled by the Xcode Scene Editor.
Cameras follow objects with a smooth acceleration and deceleration. They also can adapt their behavior in different areas, such as moving up or down depending on the area, or remaining fixed in a certain orientation.
SceneKit is transitioning to a physically based camera API. This API allows implementation of physically plausible depths of field, as well as motion blur and screen space ambient occlusion.
Rather than specifying
yFov properties, now configure the
fieldOfView in degrees or specify the
sensorHeight of the camera (analogous to a physical camera).
sensorHeight and vice versa.
You can also configure depth of field with
Depth of field also comes with automatic bokeh. Use of an HDR camera is recommended, done by setting
wantsHDR = true. Configure the bokeh with
Set motion blur with
motionBlurIntensity. Works per object.
Ambient occlusion affects how light reflects off of objects with depth where not all parts of the surface get the same amount of light. You'll see shading and shadows on the object. Set by the
screenSpaceAmbientOcclusion... family of properties.
SCNCameraController allows you to manipulate the camera. Usually accessed with
SCNView.defaultCameraController, but you can instantiate your own.
SCNCameraController to allow users to manipulate the camera with tap gestures. There are different camera modes. Some focus on an object and allow rotation, others allow you to fly throughout the scene, and more.
SCNConstraints to define camera behavior if you need something more complicated for certain games or apps. Some examples of constraints:
SCNLookAtConstraintwill keep focus on an object as it moves.
SCNReplicatorConstraintreplicates the behavior of an object. For example, the default camera behavior, it'll follow the object.
SCNDistanceConstraintwill keep you within a min/max distance of an object.
Tessellation and subdivision surfaces
Tessellation lets you provide the GPU with low-resolution models which then generates models in memory that are much higher detail. SceneKit does tessellation with
Shader modifiers create custom effects during tessellation. You can use it to create waves in a body of water, for example.
Modifies a surface.
Height maps modify a surface with changes in the height of its vertexes. Imagine starting with a perfectly smooth surface representing land on an alien planet and then applying a height map to add hills and valleys.
Vector displacement maps are an extension of height maps that also let you modify vectors in all three dimensions. Create a 3D rock from a flat surface and add texture, for example
You can use SceneKit to start with a coarse model and refine it smoother. Like, a cube into a sphere. But not objects are uniformly smooth. Subdivision surfaces can create different angles of the surfaces in different parts of the model.
This has been available in SceneKit but is now moving to the GPU for increased performance.
Feature-adaptive subdivision is now supported. Using creases, you can make certain parts of a model smooth, and others more blocky.
Keep two things in mind if you'll be using subdivision surfaces:
- When loading
SCNScenefrom files, make sure to specify the
- When creating
SCNGeometryElementobjects programmatically, use the
.polygonprimitive type. This is to use quads, not triangles.
SCNAnimation protocol and
SCNAnimationPlayer class that make it easy to start animations and mutate them live.
You can blend animations together, too.
A new SceneKit Instrument helps with:
- Understanding performance issues
- Recording a trace of SceneKit's behavior
- Providing accurate per-frame performance analysis
SceneKit's Scene Editor also has new features, including a new Shader Modifier Editor.
Support for ARKit using
ARSCNView, a subclass of
SCNView. Very easy to set a texture or SceneView's background to the output of an
You can have objects in an AR scene cast shadows too.
GameplayKit components can drive SceneKit objects.
- Improved support for USD
- Better material bridging
- Support for animations
SCNNode conforms to
UIFocusItem to let you select and focus on objects on the Apple TV using your remote.
- Support for point cloud rendering
- New transparency modes
- Support for cascaded shadow maps