Game Development Reference
In-Depth Information
}
First you create SCNLight and SCNNode objects. As you can see, you will set the type
of light to the light object. A light type of SCNLightTypeAmbient does not need to
set a direction, position, attenuation, spotlight angle, or shadows since an ambient light is
for the entire scene.
Don't forget to call this method in the createMainScene() method, similar to
setupLighting(mainScene) .
Materials
Now you will dive into how Scene Kit manages the visual attributes of your objects.
Scene Kit uses the SCNMaterial class to control the lighting and shading attributes for
the geometry of your SCNNode .
Scene Kit provides eight different properties you can use to set these attributes.
Diffuse : Diffuse shading is the amount of light and color reflected in all dir-
ections.
Ambient : Ambient light is reflected in all points from the surface at a fixed
intensity and fixed color. If there is no ambient light object in the scene, this
attribute has no effect on the node.
Search WWH ::




Custom Search