< Return to Video

Unity 5 Graphics - Lighting Overview - Unity Official Tutorials [beta 10]

  • 0:01 - 0:05
    Lighting in Unity 5 is more fully featured than in any previous versions of Unity.
  • 0:05 - 0:12
    The lighting pipeline now includes Realtime Global Illumination in addition to traditional Baked lightmapping.
  • 0:12 - 0:20
    This, combined with the physically based Standard Shader, gives you more power and versatility to easily light more complex scenes.
  • 0:20 - 0:27
    One of the key differences in the lighting pipeline is Unity’s new Realtime Global Illumination or “GI”.
  • 0:27 - 0:30
    GI is available for all lights working in the scene.
  • 0:30 - 0:38
    This means that all lights in the scene affect the objects within range with indirect illumination as well as direct illumination.
  • 0:38 - 0:42
    Direct Illumination comes from the light shining on the objects in the scene.
  • 0:42 - 0:48
    Indirect Illumination, however, is the light reflected, or bounced off of, other surfaces in the scene.
  • 0:49 - 0:54
    Direct and Indirect light will blend together to create a much more realistic look.
  • 0:54 - 0:58
    A new scene in Unity comes with a default skybox
  • 0:58 - 1:05
    and a default directional light that is aligned with the skybox, in addition to the default main camera.
  • 1:05 - 1:11
    Each scene also contains ambient light, which can be comprised of a number of factors.
  • 1:11 - 1:15
    In the Lighting panel’s Scene tab, we have options for ambient light
  • 1:15 - 1:18
    with a choice of skybox colour
  • 1:18 - 1:21
    a user defined gradient of 3 colours
  • 1:21 - 1:24
    or a single colour.
  • 1:26 - 1:36
    This means that any object added to the scene will receive this light, unless values are set to black.
  • 1:40 - 1:44
    When lighting scenes in Unity 5, we can work with real-time lighting
  • 1:44 - 1:48
    baked lighting or a mixture of both approaches.
  • 1:48 - 1:54
    Real-time lighting is more easily modified at runtime, but comes at a cost to performance.
  • 1:54 - 1:58
    Baked lighting pre-calculates much more detailed lighting information
  • 1:58 - 2:01
    and saves it to a lightmap - a texture on disk.
  • 2:01 - 2:04
    This lightmap information is read from disk at runtime
  • 2:04 - 2:10
    and this approach avoids the need to do calculations later, saving performance at runtime.
  • 2:10 - 2:16
    Using Baked lighting exclusively would be more appropriate for devices with lower performance capabilities,
  • 2:16 - 2:18
    such as mobile platforms.
  • 2:18 - 2:25
    Lights can be switched between Realtime, Baked and Mixed lighting on a per light basis.
  • 2:28 - 2:33
    The light mapping system can work in either "Iterative" mode, or "On Demand" mode.
  • 2:33 - 2:40
    Iterative mode will bake any lighting changes in the background as you edit properties.
  • 2:48 - 2:54
    On Demand mode will only preview changes once the "Bake" button in the Lighting panel has been selected
  • 2:54 - 3:01
    in a similar way to how previous versions of Unity functioned with baked lighting.
  • 3:09 - 3:13
    In this scene, we have a directional light coming in through the sky light at the top
  • 3:13 - 3:18
    casting shadows that you can see around the chamber area from the furniture inside.
  • 3:19 - 3:22
    This light contributes to the illumination for the rest of the scene
  • 3:22 - 3:27
    because it bounces from the surfaces it lights directly onto others.
  • 3:27 - 3:33
    If I decrease the intensity of this light, you can see the illumination of the room decreases also.
  • 3:33 - 3:36
    Likewise if we simply rotate the directional light
  • 3:36 - 3:41
    you can see that as it has moved to directly light a different part of the scene
  • 3:42 - 3:47
    we can see the light now bounces to illuminate the ceiling more effectively.
  • 3:50 - 3:56
    The rest of the room is lit with Point and Spot lights as well as Emissive surfaces.
  • 3:56 - 4:03
    This means that we can give our scene a very different feel by changing some of the colour values in the contributing lights.
  • 4:03 - 4:06
    As these elements are part of the realtime lightmapping
  • 4:06 - 4:10
    we can also control these lights at runtime using coding or animation.
  • 4:11 - 4:16
    This allows us to create complex changes in mood during our games and projects.
  • 4:16 - 4:21
    As the new standard shader can mimic a wide array of physical surfaces in your projects
  • 4:21 - 4:26
    you can expect certain materials to have different amounts of reflectivity as far as light is concerned
  • 4:26 - 4:31
    To help balance this, you can either adjust Bounce Intensity on a per light basis
  • 4:31 - 4:34
    or globally using the settings in the Lighting Panel.
  • 4:34 - 4:39
    Albedo scale lets you artificially increase the potential bounce for dark scenes.
  • 4:41 - 4:48
    Indirect scale allows you to boost or decrease indirect light in the scene for realtime and baked lightmaps.
  • 4:48 - 4:52
    Direct scale allows you to boost the light in baked lightmaps.
  • 4:52 - 4:58
    AO Exponent controls the amount of Ambient Occlusion and also only applies to baked lightmaps
  • 4:58 - 5:02
    allowing you to darken bounced lighting in occluded areas.
  • 5:02 - 5:06
    In addition to lights, we can use Emissive surfaces to contribute to lighting.
  • 5:06 - 5:10
    In this scene we can see a lit panel around the ceiling of the room
  • 5:10 - 5:13
    and various strips of geometry in the wall panels
  • 5:13 - 5:17
    all of these utilise the standard shader’s Emissive property
  • 5:17 - 5:22
    You can see that by adjusting the emission scale - the float value next to the property -
  • 5:22 - 5:29
    and adding a touch of colour, we can vastly change the mood of our scene.
  • 5:39 - 5:44
    The final contributory factor in lighting your Unity scenes are Probes.
  • 5:44 - 5:48
    There are now two types of Probe in Unity - Light and Reflection probes.
  • 5:48 - 5:52
    Light probes function in much the same way as in previous versions of Unity,
  • 5:52 - 5:57
    acting as a grid of points via which you can sample the light at different positions in the world,
  • 5:57 - 6:04
    and cast it upon dynamic objects such as characters and other moving elements, with low performance cost.
  • 6:04 - 6:07
    Reflection probes act as a single point of reference for reflection,
  • 6:07 - 6:14
    with an accompanying cubic volume to allow you to specify what should be included in the reflection.
  • 6:14 - 6:18
    These probes sample elements surrounding them using box projection
  • 6:18 - 6:22
    and store the information in a cubemap.
  • 6:22 - 6:27
    Materials with reflective shaders that are on objects within the Reflection probe’s volume,
  • 6:27 - 6:31
    can then reference that cubemap to create reflective surfaces.
  • 6:31 - 6:35
    As such, you should keep this in mind when designing the lighting of your scenes,
  • 6:35 - 6:40
    as the reflectivity of surfaces should be factored into the overall lighting.
  • 6:42 - 6:49
    So ultimately, lighting in Unity 5 is a balance of ambient light, direct and indirect light and reflections.
  • 6:49 - 6:56
    For more information on the new lighting systems in Unity 5, please see the information linked below.
Title:
Unity 5 Graphics - Lighting Overview - Unity Official Tutorials [beta 10]
Description:

more » « less
Duration:
06:57

English subtitles

Revisions