Unity 3D - Tutorial 2 - Lighting in Unity

Veröffentlicht am: 23 September 2017
auf dem Kanal: bpwebmedia
6,878
36

1. In this tutorial, we’re going add some lights to the scene and adjust their settings. We're starting with the tank we created in tutorial 1, but you can test the lights on any scene if you don't have the tank scene.
2. There are four standard types of lights available in Unity: Directional, Point, Spot and Area
3. There may already be a directional light in your scene by default. Delete it by right-clicking on it in the hierarchy panel and selecting ‘delete’ from the dropdown menu
4. The Directional light is like the sun and it is usually used to illuminate an entire scene
5. A Point light behaves similar to a light bulb, lighting up whatever is directly around it but losing intensity as we get further away from the source.
6. Spotlights behave like spotlights in real life, like you would see at a concert or stage performance of some kind, where the light creates a bright illumination around whatever object it is pointed at and lights it up dramatically, like a torch, car light or searchlight.
7. The area light emits light from one side of a rectangular shape and creates a softer, subtler lighting effect that can be suitable for more realistic scenes, interiors or e.g. street lighting.
8. Before we set up the lights in the scene, let’s add a simple environment for the tank
9. Go to GameObject and add a ‘Plane’ from the 3D Object menu. Reposition and resize so that the tank is resting just on top of it, as if the plane were ground terrain to drive around.
10. First, we will add a directional light to the scene from the ‘Light’ menu in ‘GameObject’
11. Try moving it around and scaling it. Notice that this has no effect on the light in the scene.
12. The only property that matters with the directional light is the rotation. Adjust the rotation and you will see that the light moves, casting longer or shorter shadows.
13. By default, the directional light may be too bright for the scene, so we can adjust the intensity, and many other properties, in the inspector window. Reduce intensity to 0.5
14. You can also change the light’s colour by clicking on ‘Colour’ and choosing form the palette
15. Delete the directional light. You can also turn off the scene lighting if you want to be able to see all the objects without having any lights in the scene. Make sure it is turned on now.
16. Add a point light to the scene and place it above the tank. Experiment and move it around.
17. Rotation doesn’t do anything for the point light, only moving it changes its effect.
18. You can adjust the intensity, colour and range of the point light in the inspector panel
19. Delete the point light and now add a spotlight to the scene instead. Rotate and move the spotlight so that it looks like a front beam shining from the front of the tank
20. Duplicate the spotlight and place it on the other side so there are two lights from the tank
21. Add a directional light to the scene and adjust the intensity so we can see everything
22. Download a sand texture from google images and apply it to the plane.
23. Save your scene and save your project. These need to be saved separately.
24. This has been a short tutorial on using lights in Unity 3D.


Auf dieser Seite können Sie das Online-Video Unity 3D - Tutorial 2 - Lighting in Unity mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer bpwebmedia 23 September 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 6,878 Mal angesehen und es wurde von 36 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!