## 6 Data Transfer and the Creation of a 3D Model for VR and AR
### Finalisation of Results  
The workflow developed for working with 3D models and optimizing them for VR in Phases 1 and 2 of the project was of great benefit for the future processing of large 3D models. During the completion of the work on the shrine in Alqosh in 2021 and the creation of the final 3D model of the already reconstructed shrine, a technological breakthrough came--based on the rapid development of Unreal Engine, a new version was released, and so it was decided that the entire project and application would be re-created in the new version of Unreal Engine 5, which can work significantly better with large meshes and which marks a really big step forward in the creation of VR models. Figure 19 shows what the application looks like and the high detail of the 3D model in the virtual world. The process of uploading the 3D model and subsequent editing has been greatly simplified as Unreal Engine 5 is now able to work directly with large models, including our model of 17 million polygons, and there is no need to divide the 3D model into sub-parts as in the older version 4.24. However, in addition to using the same procedure--cutting into multiple parts--it is possible to use an even more efficient procedure. The procedure uses high-poly and low-poly meshes where the surface quality of the high-poly mesh is encoded in 2D textures and these are then applied to the low-poly mesh. Figure 18: Flow-chart. Old procedure. The transformation was brought about by Agisoft Metashape, which released version 2.0 (31.12.2022) [49] and then the current version 2.2, where it is possible to decimate the model, smooth the model and calculate normal textures (Figure 20) and ambient occlusion maps directly within the program, eliminating the need for several different softwares with problematic data conversions. Therefore, it can be concluded that ideally only photogrammetric software is currently required--the most used being Agisoft Metashape, RealityCapture, and Unreal Engine version 5 and higher. This is a big improvement. The RealityCapture software is also capable of calculating normal maps (Figure 21). To improve the quality of the resulting 3D model, the creation of normal maps and an ambient occlusion map was used, which could not be used in the old procedure due to the splitting of the 3D model. If we decimated the cut parts to calculate the normal texture for all six parts of the model, as was done in the old workflow, then the decimated parts would not fit on top of each other. This would mean that the model would have many holes and would not be consistent. The basis for calculating the normal map is to create a high-poly and a low-poly model (decimated model), where the high-poly model presents us with a high-quality 3D model with a quality calculated surface and all the roughness. The low-poly model is reduced, and thus various details can be changed or even disappear. In the high-poly model, the surface irregularities are formed by polygons. Figure 19: Final VR application created in Unreal Engine 5—(**a**) Surroundings of tomb, (**b**) Inside look to the tomb, (**c**) Main menu—gallery about the tomb. However, for a virtual or augmented reality display, a low-poly model is required, which no longer has such high-quality surface roughness or has lost it completely by simplification. So, the normal map is calculated from the high-poly model and used in the material for the low-poly model, simulating for us these inequalities without having to add any geometry. RGB is used here as XYZ with a value of 0-1. The texture then replaces the spatial impression of the high-poly model in the low-poly model at a significantly smaller model size. In case you do not have a texture for the object at all, the Artificial Intelligence works also very well, which will create a custom texture based on your key wishes for you, including normal texture, ambient occlusion map etc. [50]. Figure 21: Sample of normal texture. Figure 20: Flow-chart. New procedure.