Time for action – Let there be light

One of your most important assets in Unity is lighting. With the right lighting effects your game can go from looking pedestrian to revolutionary. Unity has a very sophisticated lighting engine that can handle dynamic lights, baking lights with the Beast lighting system, and deferred lights.

  1. For now we will create a basic light by selecting Create | Point light which will add a Point Light Game Object to our scene:
    Time for action – Let there be light
  2. Now that you've created your point light, let's position it above the scene so that it can reflect on other objects. In the Inspector, change the Position to (0,5,0). This should put it above the scene:
    Time for action – Let there be light
  3. Let's center the editor on this light by pressing the shortcut-key F, which will focus the scene on this object:
    Time for action – Let there be light
  4. Just to make sure our light is bright enough let's set the Intensity to 4. You can either use the slider or just enter 4 in the text box next to the slider:
    Time for action – Let there be light

    You can also see that the intensity of the light has increased as there is now more light in the scene:

    Time for action – Let there be light
  5. Select the Main Camera, you will see a Camera Preview that shows the light shining down upon the ground plane:
    Time for action – Let there be light

What just happened?

We have added some lighting to our scene so that we will be able to see what's going on in our scene. Remember, that in the absence of lights in the scene there won't be much for the gamer to see. While we have created a simple lighting model here, you will see that lighting is perhaps one of the most important features that you can add to your game as it will provide a significant amount of visual fidelity to your objects.

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

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