Adding Fog And Lens Flares In Unity

Introduction

This article demonstrates how to add fog and lens flares in your Unity project.

Prerequisites

Unity Environment version 5.6.1

Once again, refer my previous article to get started.

Add lens flares in your project

Step 1

I hope you have read my previous article. First, you have to open the Unity project. Create terrain, trees and water and then, add skyboxes in your Scene View. The window should be like this.

Click on the “Play” button. The Game View will be like the following. Select “Maximize on play” option.

Again, click on the Play button to come back to Scene View. Click on the Play button again and the Game View displays into whole window.

Select the camera and fit into the camera like the following.

Click on the Play button. The Game View will be displayed.

Select direction light. Go to the flare option and click the red marked symbol.

The “Select Flare” window appears into left side. Double click on the 50mm zoom option.

Nothing is visible in the Scene View. Open the Game View. The flare is applied.

Again, click on the Play button to come back to Scene View. Click on the Flare and select the red marked symbol.

Double click on the FlareSmall option.

Click on the Play button. Small flare will be display on the Game View.

Go to the Flare option. Double click on the Sun.

Click on the Play button. The sun flare will arrive in the Game View.

Again, click on the Play button to come back to the Scene View.

Adding fog in your game

Step 2

Go to the window menu in the menu bar. Select the Lighting and pick the Settings option.

Select skybox material ND choose dark sky like below. The changes display in the Scene View and Game View.

Scroll down the mouse and go to other settings. Tick into the Fog box. Fog will be applied in the terrain.

Select hand tool, scroll the mouse and zoom it. The trees display into Clear View.

Select Fog mode and Exponential standard.

Exponential fog mode will be applied.

Select Fog mode exponential to linear.

Linear mode will be applied. Surrounding places will be displayed Clear View.

Click on the play button. The fog linear mode game view will be displayed.

Summary

I hope, you understood how to add fog and lens flares in your Unity project.