3D MODELLING AND VISUALIZATION BASED ON THE UNITY GAME ENGINE – ADVANTAGES AND CHALLENGES

3D City modelling is increasingly popular and becoming valuable tools in managing big cities. Urban and energy planning, landscape, noise-sewage modelling, underground mapping and navigation are among the applications/fields which really depend on 3D modelling for their effectiveness operations. Several research areas and implementation projects had been carried out to provide the most reliable 3D data format for sharing and functionalities as well as visualization platform and analysis. For instance, BIMTAS company has recently completed a project to estimate potential solar energy on 3D buildings for the whole Istanbul and now focussing on 3D utility underground mapping for a pilot case study. The research and implementation standard on 3D City Model domain (3D data sharing and visualization schema) is based on CityGML schema version 2.0. However, there are some limitations and issues in implementation phase for large dataset. Most of the limitations were due to the visualization, database integration and analysis platform (Unity3D game engine) as highlighted in this paper.


INTRODUCTION
Research progress on 3D technologies for city modelling standards (e.g.CityGML) and platforms (e.g.Unity3D game engine) resulting a variety of 3D GIS applications in bigger scale implementation, for example the estimation of potential solar energy from building rooftops and façades of Istanbul city (Buyuksalih et al., 2017), another example of 3D city model for large citycity of New York by Kolbe et al. (2015).
3D applications have been developed with the capability to employ more specific 3D analyses (Kurakula and Kuffer 2008) such as noise distribution and solar energy estimation.Utilization of 3D city models for business or authority operations such as in urban planning are directly highlights the benefits of 3D city models (Moser et al., 2010).
Similarly, BIMTAS company has carried out a few projects for estimating potential solar energy on buildings and 3D underground utility mapping for Istanbul city.
The paper has been organized with a brief introduction on 3D GIS modelling standards, description of project area and Unity3D game engine as project implementation platform.Second section describes briefly on projects implementation for each project implementation process.Approach in developing 3D city modelling using Unity3D game engine platform will be described in section 3. Section 4 presents result of each project/application, advantages and limitation of using Unity platform.Lastly section 5 highlights the conclusions of the paper and future outlook.

3D Modelling -CityGML
3D CityGML models are commonly used for applications which require 3D mapping, realistic simulation, better visualization and analysis.The model mostly consists of polygons as the surface either façade, roof or more details building assessor such as balcony, doors and furniture.
CityGML version 2.0 offers five levels of detail (LoDs) to be incorporated in any 3D model (see Figure 1).A detailed level of CityGML model produces a better accuracy and precision of the measurement, visualization and analysis.Figure 5 illustrates an example of different LoDs (LoD1 and LoD2) with respective analysis of shadow results.However, it consumed higher storage, graphic and processing of the devices (modelling hardware) compared to less detailed level.Thus, appropriate LoD should be carefully selected for any potential applications and desired accuracy on modelling or analysis.

Unity3D Game Engine
Unity is a cross-platform game engine designed to support and develops 2D and 3D video games, simulations for computers (e.g. Figure 2), virtual reality, consoles and mobile devices platform (Unity, 2017).It is commercial software developed by Unity Technologies.Unity 3D provides three dimensional manipulation and simulation through functions defined using programming languages.
The engine capable of making high quality games, design and develop 3D social network gaming platforms (Bae and Kim, 2014).In addition, 3D visualization, functions and attributes, intelligence and metric measurements can be done with Unity 3D encoding.

Built-in Game & Map Functions
Unity3D features such as flight, rotation, pan, zoom in and zoom out can be used.The camera, light and other types of objects are offered to the user in the scene.Standard mapping functions such as projection system, information, and on-off layer are built based on the Unity platform.Specific function such as query, shadow calculation, solar radiation and sun locator and angle are being embedded in the equations and internal codes (not in the viewer).

Built-in Analysis
Unity game engine provides a platform either to use their libraries or our own codes for supporting application analysis.
Built-in analysis such as estimating solar potential project uses several available libraries and localizes algorithms including effectiveness of roof-mounted and façade-mounted system, using photovoltaic (PV) and thermal.The project also implemented some related methods on solar analysis available in others solar estimation application -shadow calculation, sunlight location and angle, direct or indirect reflection and others.

Project Implementation Area
Building models can be extracted from both aerial images and LiDAR data (Wang et. al, 2008).Digital Surface Model (DSM) and Digital Elevation Model (DEM) for the whole Istanbul were acquired by the previous project (data collection using Airborne LiDAR), two years ago.
The first project is to estimate potential solar energy buildings, covers the whole Istanbul (5,400 square kilometres, around 1.5 million buildings) as illustrate see Figure 3.The project uses LoD2 and LOD3 CityGML standards as 3D city model schema.
The second project focuses on customization of 3D underground utility mapping and tools to support several 3D underground analyses.The Figure 4 shows the utility network over the city.

PROJECTS IMPLEMENTATION
This section is divided into two subsections -estimating potential solar energy 3D city modelling and 3D underground utility mapping.

Estimating Potential Solar Energy -3D Istanbul
Solar energy modelling is increasingly popular, important, and economic significant in solving energy crisis for big cities.It is a clean and renewable resource of energy that can be utilized and solving power crisis to accommodate expansion of urban and the growth of population.However, as the spaces for solar panel installation in cities are getting limited nowadays, the available strategic options are only at the rooftop and façade of the building.Thus, accurate information and selecting building with the highest potential solar energy amount collected is essential in energy planning -installing photovoltaic (PV) system and panels.
Sunlight comes to the earth as a form of electromagnetic radiation.Solar energy is radiant light and heat from the sun which is very beneficial and crucial as renewal energy.Solar energy radiation at earth's surface varies due to absorption, scattering, reflection, change in spectral content, diffuse component, water vapour, clouds pollution, shadow (Figure 5) and others (Alam et. al.,2013).
Solar potential analysis can be used to localize the most suited areas on a building in its urban (Good et. al., 2014).Several method of solar analysis was proposed in Good et. al (2014).The project also implemented some related methods on solar analysis available in others solar estimation application.They are shadow calculation, sunlight location and angle, direct or indirect reflection and others.
The implementation of this solar estimation project for Istanbul uses CityGML LoD2-LoD3.The model and analyses were carried out using Unity3D game engine with development of several customized tools and functionalities.

3D Underground Utility Mapping
The aim of the project is to provide the 3D modelling of the natural gas network with integration of the pipelines on 3D City Modelled Map.Natural gas network can be built by integrating 3D models metric and geometrically with high precision and 3D city model created in Unity 3D software (Windows application).

3D GIS MODELLING IN UNITY
As industry experts and connoisseurs of the tool, they explained that one of the biggest beneficiaries of using Unity3D is Android.
Being, in the market with more users and more devices in circulation has many advantages.This is especially reflected when analysed from a social point of view.The project was completed in two years; starting from converting CityGML data LoD2 -LoD3 (with photos) into Unity supported formats (e.g. in this project mostly use .fbxformat).The final results (estimated potential solar energy for each building façade and rooftop) are acquired via implementation flow as illustrated in Figure 6.

Pre-Processing Flow (Preparing input data)
Figure 6.Pre-processing phase for unity input model.

Estimating Solar Energy Project
The custmized Unity application was named as Istanbul Gunes Enerjisi Verimliligi as default view in Figure 7.
Figure 7. Default GUI view of Istanbul Solar Estimation.

3D Underground Utility Mapping
Conversion of CityGML data to Unity supported format (.fbx), projection, orthophoto images and basic mapping tools (zoom-in, pan, rotate, selection of object and others) has been completed.However the customized functions (see Figure 8) for supporting underground utility is still in progress.

Challenges
Estimating the solar energy/radiation from rooftops and facades has some limitationse.g. the shadows from other neighbouring buildings.One of the biggest issues in solar radiation calculation in urban area is shadow casting.It affects the accuracy of the potential radiation results as for high storeys buildings.The size and position of the shadow caster directly impact on energy collection (Alam et. al., 2013).Solar irradiance can be estimated while incorporate shading effects of surrounding buildings with generated lines pointing towards the direction of the sun at the specific points in time (Wieland et. al., 2015).Alam et. al (2013) uses potential building surfaces of the city model (CityGML) and sub-divided them into triangles again and again into smaller triangle like octree hierarchical process.The coverage of the triangles (every level) will determine the solar irradiance of particular CityGML building surfaces.
For the 3D underground utility mapping, data interoperability of the utilities layer (pipeline, gas and others) is one of the highlighted challenges.Layers need to be prepared in valid topological elements (e.g.not intersect 3D, connected network) and it was extracted from shapefile format (.shp).Converting format 2D shp to 3D fbx format is one of the difficulties of this project.

MODELLING OUTCOMES, ADVANTAGES AND LIMITATAIONS OF USING 3D UNITY GAME ENGINE
Final outcomes are presented in section 4.1, while advantages and limitations are discussed in the sections 4.2 and section 4.3 respectively.

Estimating Solar Energy Project
The outcomes show the estimation of potential solar energy received for the whole area by day, week, month and year, thus the decision for installing the solar panel.Calculation of the energy will be made based on the rooftops or/and façades of a selected building.Figure 9 and Figure 10 show a selected building with rooftop as solar panel just before and after the calculation take place.While Figure 11 shows the calculation (estimation of potential solar energy received by) on the selected building façades.
Figure 9. Selection of a particular building to be calculated.
Figure 10.Solar estimation for the selected building rooftop.
Figure 11.Solar estimation for the selected building façade (potential solar panel).

3D Underground Utility Mapping Project
This is a ongoing project -visualization of 3D buildings and data modelling (orthophoto-terrain and underground cables) are in progress as shown in Figure 12, 13 and 14 respectively.

Advantages of 3D modelling in Unity
The main advantage of Unity3D is that it can run on multiplatform with online and offline modes on Windows, Mac, Linux and mobile platform (Ruzinoor et. al., 2014).Most of Unity 3D development projects are based on Android platform due to integration simplicity.Unity also allows user to publish the developed games on other platforms such as iPhone and Windows phones or tablets with large number of users.The game engine also capable of importing other 3D models in FBX, SBX and OBJ formats.
Unity 3D game engine provides good visualization and light rendering of 3D objects, thus major advantage for modelling 3D spatial geometry.It provides variety of functions and modules library for multi specifications of the gaming development (Bae and Kim, 2014).
For these two projects, Unity 3D provide a flexible platform especially to customize appropriate functions and modules for application needs.As compared subscribing commercial software such as AutoCAD Map and ESRI City Engine, only default functions are available.

Limitations of 3D modelling in Unity
Some general limitations for Unity 3D are as listed below: • It does not allow developer to start from a foundation or template.Any game or project needs to be implemented from scratch to the detailed functions with GUI.• From a graphical point of view, Unity game platform performs slower than other engines such as UDK (Unreal Development Kit). • High costs.
Other specific limitions on 3D modelling (mapping context) will be highlighted in the following sub-sections.

No Coordinate Transformation Projections
Most of the 3D modelling software could not cope with spatial data is because of the projection system.Unity also did not support coordinate system as for their libraries/modules.There are no transformation tools or libraries for coordinate's conversions.

Format Interoperability Problems (GIS)
The Unity 3D game engine supports very limited input formats e.g..fbx,.sbxand .objwhich focuses on geometry; vertex and faces ordered.Thus, creates limited interoperability during conversion process such as loss of semantic and attributes (information in the column fields).

Single / stand-alone file and Limited Databases Support
Unity uses only a single file (or single file directory) to store all the codes, functions, GUI properties as well as the datasets (2D and 3D) of a project, thus consumes huge memories (RAM and ROM) of the computer system.Other disadvantageit is a standalone system which hardly able to integrate with other software such as database.

Less Users, Documents and Supports for 3D Mapping
Unity is designed for game development where most of the manuals, tutorials and sample projects are associated with the gaming specifications and developments.The game engine can be considered as very specialized tool for 3D visualization of spatial objects.It has various limitations and other drawbacks, thus very limited users, documents and supports.

3D Game Engine for 3D GIS Visualization
This section describes the potential of 3D Unity visualization and game engine for 3D GIS visualization.There are several visualization packages meant for GIS, however most of those packages have very limited functionality for 3D GIS modelling and visualization, e.g.ArcScene, Bentley Map, MapInfo Discover 3D, AutoCAD Map 3D as reported during the workshop (TU Delft, 2011) as well as by Abdul Rahman (2016).The development of 3D visualization from those packages is still in progress and working toward solutions for 'real' 3D GIS visualization requirements.
3D spatial database component is quite essential in any spatial information system.We anticipate those two projects could be extended for a bigger scope in 3D spatial database component, i.e. providing answers for spatial and non-spatial queries of 3D object.We also recommend a transformation of 3D objects (CityGML) into GIS-based layers where more spatial or/and spatio analysis could be carried out on the layers.
All these layers from two different projects (solar energy estimation and underground utility) would be useful for future GIS-based smart cityplanning and management.Later, new 3D layers or objects could be added or integrated to provide multifunctional applications within a single smart city model, in this case -3D Unity.

CONCLUSIONS
We have described the 3D modelling for estimating potential solar energy on buildings surfaces and underground utility mapping using Unity 3D game engine platform for Istanbul.These applications provide precise measurements (e.g.solar energy estimation and location of underground utilities), analysis and better visualization especially for city planners.
Some advantages and limitations of the game engine also highlighted.The Unity 3D game engine itself is the most high quality game engine available in the market, easy to use and shorter rendering duration are mostly suite for game developers and companies.We strongly believe this 3D game engine could be extended for better visualization, format interoperability, database and other spatial related functions or applications in the near future.

Figure 2 .
Figure 2. Examples of 3D scenes from Unity's sample projects (Unity, 2017) Unity has three important components (Unity, 2017); • A game engine: This allows the games to be created, tested and played in different environments.• An application where the design or the user interface is put together with a graphics preview option and control play function.• A code editor: The IDE provides a text editor to write code.However, a separate text editor is often used to avoid confusion.Unity is an excellent platform to start game development and definitely recommended for developers who want to jump start game development.Unity provides numerous tutorials based video examples that make a developer familiar with the development process.

Figure 3 .
Figure 3. Istanbul province as the first project (estimating solar energy) study area.
Unity is an excellent platform to start game development and definitely recommended for developers who want to jump start game development.Unity provides numerous tutorials based video examples that make a developer familiar with the development process.• Rendering: The Unity graphics engines use OpenGL, Direct3D, OpenGl ES for mobile platform (iOS, Android) and various APIs.There is also support of reflection, parallax and bump mapping.It provides features to render text and use of shadow maps for dynamic shadows.Various file formats of different software are supported.For instance, Adobe Photoshop, Blender and 3ds Max are supported.• Scripting: Scripting is built on Mono, the open source platform for.NET Framework.Programmers write the UnityScript similar to JavaScript, C sharp and Boo.• Physics: The Unity engine provides built-in support for PhysX physics engine with real time cloth simulation on skinned meshes, collision layers and thick ray casts.