# Virtual Reality in Cultural Heritage: A Setup for Balzi
## 3 Materials and Methods
### Second Iteration of the Balzi Rossi VR Experience  
As of February 2023, subsequent to the unveiling of Unreal Engine 5 and its plethora of innovative features, a necessity emerged to conceive a second iteration of a specific application. This initiative aimed to surpass the visual excellence and fidelity of its predecessor. A prominent hurdle in the inaugural version was the imperative to segment the cliff  
Figure 4: Virtual view from Unreal Engine 4 Editor of the first iteration from the aerial platform, with the sea replaced by land and weather conditions adjusted as presumed during the Würm glaciation. model and confine the polygon count to a quarter-million to streamline the importation process into the game engine and secure optimal performance for virtual reality applications. The introduction of Unreal Engine 5 catalyzed new avenues to elevate the Balzi Rossi VR experience, notably through Nanite technology, enabling a significant enhancement in the cliff model's quality and various facets of the VR application. Nanite represents a revolutionary rendering paradigm, markedly augmenting the engine's capacity to generate intricate and detailed 3D environments [14]. This virtualized geometry system empowers creators to fabricate highly detailed assets unshackled from conventional polygon budget limitations. Nanite facilitates the rendering of immense geometric detail by streaming and processing only visible specifics at any given time, achieved by aggregating triangles into clusters. It enables developers to actualize cinemagrade visuals in real time, utilizing high-resolution source art composed of millions, even billions, of polygons directly in the game engine. Despite this intricate detail, Nanite maintains efficient performance by optimizing and scaling geometry relative to the camera's perspective, processing only essential data. This system potentially obviates the traditional levels of detail (LOD) approach for performance optimization. Additionally, Nanite allows for real-time, dynamic alterations in lighting, shadows, and other environmental variables, maintaining high fidelity without dependence on precomputed data. To harness Nanite, a transition from forward to deferred rendering was necessitated, as the former does not support Nanite's functionalities [15]. Although the light pass with deferred rendering is computationally more intensive than forward rendering, Nanite's utilization still fostered significant performance leaps. Given Nanite's exceptional optimization in rendering and consequent substantial savings in graphic resources, it was decided to augment the polygon count of the cliff model, aspiring for superior graphic rendering. The process of digital photogrammetry was resumed again with RealityCapture, initially yielding a cliff model comprising 60 million triangles. Subsequent trials revealed that surpassing a certain polygon threshold marginally affected graphic rendering. Consequently, a five million-polygon model was exported from RC and imported into the engine. This model, with its higher polygon count, was markedly more detailed than the previous 250,000-polygon version, rendering it significantly more photorealistic. During the initial importation attempt, an issue of mesh conversion into Nanite clusters caused a sudden shutdown of Unreal. After multiple resizing trials on external programs, it became evident that the error stemmed from the mesh's exceedingly large size. Subsequently, reducing the model by a factor of 100 facilitated a smooth engine importation. As commonly observed in post-3D model generation via photogrammetry, the imported mesh appeared 'dirty', with numerous unwanted parts. For the cleanup process, Unreal's internal modeling tool was employed, adeptly handling ordinary mesh optimization operations. Nanite's real-time streaming ensures fluid rendering despite the high polygon count, conserving significant hardware resources for the cliff rendering.