Time for action - creating Sunlight in Unity

  1. Go to GameObject ¦ Create Other ¦ Directional Light.
  2. Click on Color and select the shade you want. Slightly off-white is good. Then click on x.
    Time for action - creating Sunlight in Unity
  3. With the light selected, click on the Rotate button as shown in the following screenshot. Now, use the cursor on the globe to rotate the light so that the rays are pointing tards the terrain.
    Time for action - creating Sunlight in Unity
  4. Now, select all the parameters in the Inspector panel in the next screenshot:
    Time for action - creating Sunlight in Unity
  5. This is just an approximation of some daylight. I've placed the light high up, slightly to the left-hand side, and behind. Remember, x=0, y=0 is the bottom left-hand side of the map because that's where the origin was in SketchUp.
  6. Label it Daylight in the box at the top, and press Enter.
  7. Now, create another light in the same way—this time select the Pointlight option. Before you alter anything, click on the Move icon at the top of the screen. Use the Red, Blue, and Green arrows on the light to move it over the area in the center of where the industrial building will go.
    Time for action - creating Sunlight in Unity
  8. Rotate your view with the middle and right-hand side mouse button so you can see the correct height too (See the next image):
    Time for action - creating Sunlight in Unity
  9. When you're done, alter your color, range, and intensity to suit your preference. You can always come back and change this later.
  10. If you wish, you can switch off the sunlight by clicking on it and un-checking the box in the Inspector pallet that says Light. This will let you see the strength of your second light more easily.
  11. Label your new light Indoor01.
  12. Now, right-click on it in the hierarchy, and select Duplicate.
  13. Move this new light to the side a little, then label it—you guessed it!—Indoor02.
    Time for action - creating Sunlight in Unity
  14. Turn your sunlight back on.

What just happened?

You set up one directional light to simulate sunlight, and two Omni lights to act as indoor lamps. The directional light is set high up (large Y-axis number) to simulate the sun. Because it's a directional light you had to adjust its tilt and rotation so that it's shown on the terrain. We placed it at an offset to one side so that you would get the effect of depth on the shaded portions of the terrain. The other two lights needed a number for range so that their effect wasn't too strong. You can see the range by the yellow globe around the light in the main view. Unfortunately, Unity free doesn't allow for realistic shadows from its lights; you need to pay for the Pro version for that.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.184.102