官术网_书友最值得收藏!

Time for action - move and rotate the light

This new light is really harshing our mellow. Let's move and rotate it so that it casts light a little less blazingly.

  1. Ensure that the Directional Light is still selected. If you deselected it, click on the Directional Light label in the Hierarchy panel.
  2. In the Inspector panel, change the light's position to move it up and in front of our Scene. Enter 0 for the X position, 4 for the Y position, and -4 for the Z position. Moving a Directional Light like this does not alter its intensity, but we're just making sure it's within reach in the Scene view.
  3. Rotate the light so that it shines down on the objects. Enter a value of 44 for the light's X Rotation in the Inspector panel.
    Time for action - move and rotate the light
  4. Now, the light is casting its sunny rays a bit more naturally on our Scene.
Time for action - move and rotate the light

Have a go hero - let there be (additional) light

If you're feeling adventurous, now's a great time to get a better feel for these virtual lights. Switch to the rotate mode by using the controls at the top-left of the screen, or press the E key on your keyboard. You can freely rotate the light around to see how it affects your objects.

Have a go hero - let there be (additional) light

Switch to move mode by clicking on the Move icon or by pressing W on the keyboard. Click on the Transform gizmo to move the light around the scene. How does moving the light affect the way your objects appear?

Kill the light by pressing Delete on the keyboard (Command + Delete if you're on a Mac). Add one of the other two types of lights a spotlight or a point light by clicking on GameObject | Create Other and choosing another light. You can also change an existing light's type in the Type drop-down in the Inspector panel. What's the difference between the light you chose and the Directional Light? Move the new light all around to get a sense of how each light type treats your objects slightly differently.

Here are the differences between the lights in a nutshell:

  • Directional light: This light can travel an infinite distance and illuminate everything in the Scene. This kind of light works like the sun.
  • Point light: These lights start at a point in 3D space and shine all around like a lightbulb. Unlike directional lights, point lights have a range anything outside of that range doesn't get lit.
  • Spotlight: Spotlights are cone-shaped. They have a range and a direction. Objects outside a spotlight's cone don't get lit by that light.
  • Ambient: This is the default type of lighting that you see in your Scene, without adding any light Game Objects. Ambient lighting is the most efficient, but it's also the most boring. You can crank the level of ambient lighting in your Scene up and down by fiddling with the render settings (Edit | Render Settings). Try clicking on the Ambient Light swatch to cast a creepy, bright green glow over your entire Scene.
Have a go hero - let there be (additional) light

Extra credit

If this lighting stuff really revs you up, check out all of the settings and things to fiddle with within the Inspector panel when you select a light. You can get more information on what these and any other Component settings do by clicking on the blue book icon with the question mark on it in each Component section in the Inspector panel.

主站蜘蛛池模板: 女性| 龙川县| 手机| 潞西市| 贺兰县| 青浦区| 延长县| 祁东县| 句容市| 南涧| 柘城县| 黔西| 新乡市| 仲巴县| 嵊泗县| 永州市| 中西区| 浦县| 藁城市| 鱼台县| 丰原市| 莱芜市| 松滋市| 韩城市| 岑溪市| 平南县| 新津县| 日喀则市| 七台河市| 梁山县| 当阳市| 东明县| 靖宇县| 太和县| 建德市| 尼勒克县| 积石山| 安西县| 石渠县| 和田县| 仁化县|