Lights Flashcards

1
Q

types of lights

A

spot, point, direction, area

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

global illumination

A

models complex lighting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In this lesson we learned…

A

What are the difference between the light types?
Directional lights are lights that simulate the sun. Moving a directional light doesn’t change how things are lit in the scene. However, rotating the light does change things a bit. It can simulate a setting or rising sun, for example.
Point lights work like light bulbs. They emit light from a sphere around its current position. Rotating a point light, has no effect on the lighting. Unity fades the light intensity as you get further away from the light. Closer to the light will appear much brighter than lighting at the end of its range.
Spot lights work like flashlights, stage lights, or lighthouse light. These lights shoot a cone of light out from its origin and change lighting based on the spot light’s position AND rotation. The Spot Angle value changes the width of the cone.
Area lights act like flood lights in a stadium and are much more complex and can’t be run in realtime. They must be baked or precomputed.
How are the four light types similar?
All of the lights have the following properties that can be adjusted to suit your experience.

Color - This property lets us change the color tint of our light. Make a light red and another blue to simulate emergency lighting. Or make a traffic light by making a red, a yellow, and a green light.
Intensity - This is how bright or intense our light is, and ranges from 0 (no effect) to 8 (max effect that’s almost blinding).
Shadows - Can be computationally expensive when done incorrectly. Options:
No Shadows - no shadows at all. This is the recommended setting for mobile, realtime lighting.
Hard Shadows - only shadows with hard edges. This type of shadows don’t exist in the real world, but they are more performant.
Soft Shadows - most realistic shadows with softer edges. These are the most expensive type of shadows and can impact performance.
Render Mode - Lets us define how important our lighting is. Keep on Auto generally. If Unity sees that we’re struggling with performance, it can turn off the light to improve performance.
Culling mask - Choose which layers to render the lighting on.
What is baking?
Baking is the process of calculating our shadows and lighting data before we actually run our experience. We can compute lighting effects, light bounces, and realistic shadows. This data is saved in a lightmap texture that is referenced at runtime. In order to get the most out of baked lighting, the light and objects in the scene need to be marked as static. Baked lighting doesn’t work for objects or lights that move in the scene as those can’t be computed in advance. To bake our lighting:

Set non-moving objects to static by clicking the box in top of the Inspector window. This needs to be done for each object.
Set light(s) to static by changing the light “Mode” property.
Window > Lighting > Settings to open the Lighting window.
In the lighting window, hit Generate Lighting.
What’s the lighting window about?
The lighting window has 3 tabs. This window contains a lot of information about how we light our scene. We open the lighting window by going to Window > Lighting > Settings and docking the window in our Unity editor.

Scene: This tab lets us control the settings of light in our scene.

Environment Lighting - Remember that skybox material we created a couple of lessons ago? We can use that material here, to apply it to the scene. Ambient Lighting, a light source that affects all objects in the scene in all directions, can also be set here.
Global Illumination - This is Unity’s model of how light bounces off of nearby objects. This portion (containing Realtime Lighting, Mixed Lighting, and Lightmapping Settings) allows us some control over the parameters Unity uses when baking lighting.
Global Maps: After we bake a scene, we can see what our light maps look like on this tab. It’s pretty hard to see much in the small image here, but you can see stats about how much data is being stored to make decisions to optimize your maps.

Object Maps: We can look at specific properties of a selected game object in this tab.

What other quality settings can I use to make my scenes look more polished?
Go to Edit > Project Settings > Quality to see the Quality Settings. If we’re only interested in mobile for our project, we can delete most of the default settings (by clicking on the Trash can icon in the inspector) and leave only “Fastest”. Click on Fastest so we can edit some of the settings for this quality setting.

Set Pixel Light Count to 0.
This setting tells Unity how many realtime lights it should consider for a single pixel. If we have no realtime lights in our scene, setting this to 0 is ideal.

Set Texture Quality to Full.
This will help reduce the quality of textures, if they aren’t optimized for mobile. If we’ve already optimized the textures in our scene, we can set this to full for mobile and be fine.

Set Anti Aliasing to 2x Multi Sampling.
This helps reduce blurred edges and lines in our VR scenes. It’s a little more computationally expensive, but in VR we’re using less than half of the resolution of the display so it’s more of a problem to have the blurry lines. Making the computational cost, worth it.

Set Shadows to Disable Shadows.
This only disables our realtime shadows and has no effect on baked shadows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly