Monday, December 9, 2024
HomeGame EngineHow to Use Lights and Cookies in Unity to Beautify the Scene...

How to Use Lights and Cookies in Unity to Beautify the Scene (Part 1)

Lights are an important part of a scene. Even when you are looking around in the world, light is what it’s all about. Now just like in the natural world, there are a few types of lights, for example, spotlight, sunlight, etc. This Tech-recipe is all about using lights to make the scene much more attractive and of course lit!!!

How to Use Lights and Cookies in Unity to Beautify the Scene will have a part 2. This part will explain all the lights, In the next, we will show how to use them in the scene. As I always mention, when developing a game in unity you should always look around you. Observe the real world and bring it your game in unity. Just right now, look around you. You have got sunlight, you might have gotten just a lamplight, or the chances of this are few but you might be walking down an aisle right now, with a spotlight on you.

The point is that to bring a scene to life, the way you handle the lighting is important.

Now in unity as soon as you create a scene you get, a directional light in the hierarchy, which is basically lighting the whole scene. Sounds boring right? There are 5 types of lights in unity.

How to Use Lights and Cookies in Unity to Beautify the Scene

1. POINT LIGHT

The point light is located at a point in space and sends light out in all directions equally.Point lights are useful for simulating lamps and other local sources of light in a scene
You can change the location of the light. The intensity depends on the distance from the source, the intensity can reach zero at a certain distance. Light intensity is inversely proportional to the square of the distance from the source. This works with the rule ‘inverse square law’ and is similar to how light behaves in the real world.

2. SPOTLIGHT

Spotlights as you already know focus on a point. a spotlight has a specified location and range over which the light falls off. However, the spotlight is constrained to an angle, resulting in a cone-shaped region of illumination. Light also diminishes at the edges of the spot light’s cone. Widening the angle increases the width of the cone

3. DIRECTIONAL LIGHT

Directional lights can be compared to sunlight in the natural environment. It is best to not mess with the default directional light. Directional lights can be thought of as distant light sources which exist infinitely far away. A directional light does not have any identifiable source position and so the light object can be placed anywhere in the scene.

4. AREA LIGHT

An area light illuminates an object from several different directions at once.  This light can be used to create a realistic street light or a bank of lights close to the player. A small area light can simulate smaller sources of light such as tube lights in the house. This type of lighting creates a more realistic effect. (Area lights are baked only, so I could not show it here)

5. AMBIENT LIGHT

All other lights have a light source. But ambient light is different, it doesn’t have a source. It is just present all around the scene. It can be an important contributor to the overall look and brightness of a scene.

 

This tech-recipe is going to have another part.

For now, see other tech-recipes

Joudet Ahsan
Joudet Ahsan
SEO Content Creator, a Computer Scientist in making and someone who sucks at writing bios.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!