**4.2 Lights combinations and their complexity**

All mentioned light types can be used at a same time and multiple times in a scene. **Figure 7** shows implementation of spot light, which is red, point light which is blue, and directional light which is white.

All lights presented in **Figure 7** are casting shadows. All objects are casting and receiving shadows as well. This is an example of how light can simulate the real-world behavior of lighting. Even though it looks natural and realistic, it is needed to keep in mind that there is a lot of calculation done in the background. It is possible to observe that blue light is illuminating the shadowed part on a terrain from the red light as well as the not shadowed part. Directional light illuminates area of red light and blue light at once but also creates shadows on a left from the cones. All lights are penetrating areas of other light, therefore, renderer needs to consider priority of which light it will display. It is possible to bake these lights at the same time, but calculation complexity will greatly improve. Vectors from lights are crossing paths, which mean they are affecting each other. Therefore, they need to be recalculated to give a result similar, if not same, to a real world. Simply said, the more lights are used in a scene and the more they are penetrating into areas of other lights, the higher complexity lighting setting will have. If renderer needs to take shadows into account, it needs to calculate position, rotation, and size of an object for every light separately as well. And lastly, renderer needs to compare position of the object which is receiving the shadows to an object which is casting the shadow. When creating a 3D scene, it is advised to consider lighting logistics depending on the strength of the computational core as it can cause computational load which can result in small FPS.

Wheelchair simulators were using few point lights for better authenticity. But after profiling of performance was done, FPS was lower than 60 in virtual headsets. The main goal of simulator was to teach disabled person using the wheelchair and overcame obstacles. To teach that, realistic graphics were on a lower priority than smoothness of application. Due to this fact, all unnecessary lights were removed from the scene and ambient light was implemented. Ambient light is considered as the light with the

**Figure 7.** *Combination of spot light, point light, and directional light in a scene.*

#### *3D Computer Graphics and Virtual Reality DOI: http://dx.doi.org/10.5772/intechopen.102744*

lowest cost for the computational core. Therefore, shadows were not implemented at all, as ambient light cannot cast them. If shadows cannot be cast, there is no need for a shader. Result is a simple lighting setting but a lot of computational space is saved.
