Lightning effects technique comparison in unity 3D

Game consumer are always demanding a good game. They prefer realistic game graphically but processing lightly at the same time. Take lightning as an example. Lightning in game not always used as scene effects but can also used as skill effects as was introduced by Zhang and Hu [1]. But the nature of electricity is complicated and chaotic [2]. Thus it is hard to make lightning effects the way developer wanted.


I. Introduction
Game consumer are always demanding a good game. They prefer realistic game graphically but processing lightly at the same time. Take lightning as an example. Lightning in game not always used as scene effects but can also used as skill effects as was introduced by Zhang and Hu [1]. But the nature of electricity is complicated and chaotic [2]. Thus it is hard to make lightning effects the way developer wanted.
Unity 3D [3][4] is a game engine that has been used by many game developer. In Unity 3D, there is a built-in particle system that can be utilized to make game effects with almost no code. It is up to the user familiarity of the system to make many kinds of effects. While it is true, not all of lightning characteristics can be applied using particle system. There is other way to create lightning effects in Unity, that is generated procedurally from mesh or line renderer in Unity.
In this article there will be four technique to create lightning skill effects. First is lightning which introduced by Zhang and Hu. Second is particle system with addition of noise module from Unity 3D. Third and fourth will be procedurally generated using Line Renderer in Unity 3D. At the end of this article, the performance of all of those technique will be compared.

II. Method
There are four tehcnique that will be introduced. The first two will use particle system while the other two will use Line Renderer from Unity with difference approach.

A. Particle System
There are two technique that use particle systems of Unity 3D to create lightning skill effects. Firstly is Zhang and Hu lightning. The particle system is customized so that all particle will be emitted from the center to every direction spherically. The second technique is using noise module from particle system component. The noise will make each particle looks chaotic. Noise module in Unity is based on two type of noise, curl noise for it's movement and perlin noise as parameters [5]. The parameters are Strength to adjust speed and range, frequency to change how chaotic it is, and octaves as the layers of noise. Adjusting strength and frequency only is enough to mimic lightning effects, while octaves can be pretty heavy in performance. Other thing can be added to make it more similar to lightning like colors and lighting.

A B S T R A C T
Game developer team especially indie game developer mostly has small number of members and sometimes unbalanced team composition. Sometimes it has more artist than programmer, sometimes it is the opposite. At the same time, consumer will choose game that has a beautiful graphics. This demands of good graphic game can cause problem to unbalanced developer team. Therefore it is needed to know techniques that can utilize many artist or many programmer to create good graphic games. In this articles, we introduce some techniques to create special lightning effects of characters skills in Unity3D. Some of them can be created with good artistic skill. It means that this technique make use of your artist. The other technique created procedurally using Line Renderer from Unity 3D. This technique is friendly for artist since it utilze programmer. At the end of this article, all of those technique will be tested in their performance of its lightness and speed.

B. Line Renderer
Line renderer in Unity 3d works like line in computer graphic generally. There are dots or vertices (in Unity 3d case, it is called elements) and lines. Define the position of two vertices and Unity will generate the lines automatically. Thus, the technique will modify those position over time to create effects similar to lightning. With addition of lighting and color, it is enough to make the lightning realistic.

C. Test
Average CPU consumption each seconds and average FPS rates each seconds will be measured and compared. Each lightning effects firstly will be created equal. Like the number lightning objects. One objects is not enough to see the different of performance. Number of strike (particle) each seconds in each lightning objects will be adjusted equally.

III. Result and Discussion
The lower value in CPU consumption and the higher value in FPS rate, means the lighter and faster the performance is. Using only simple configuration on particle system with lightning picture like what Zhang and Hu do is the lightest and fastest. But the result of this technique depends on the picture used. So, it only work for specific effects. On the other hand, noise module can create a realistic lightning effects while still light and fast as long as we know which parameters will rise the work on processing. What the line renderer do is very specific but highly customizable. Yet, it can be very heavy. But to be noted that, even without making it emits the same amount of particle like the other two, one line is enough to make lightning effects visually. So, it's performance can still be improved.

IV. Conclusion
This articles is about four type of ways to create lightning skill effects. All of them are created using two objects in Unity 3d, that is particle system and line renderer. Each of them has different performance on CPU and FPS. It is up to the developer to use which technique that suit their needs and resources the most.