Since my last blog post, I have come to the end of my project milestones and have been working through a few issues. During week 21, I carried on texturing the remaining tiles for my modular cathedral. As I did this, I analysed the remaining tiles, working through the xView checks one last time and exporting the meshes again, to re-import into Substance Painter. This assured me that I had the most updated version of the mesh which could also be imported into Unity. While working through the tiles and checking their purpose within the environment, I found that there were some extra tiles that I wouldn’t need. This was because these tiles were originally created to make up a previous version of the west end of the cathedral and/or didn’t fit correctly with the transept area tiles that I have finalised. I narrowed my tiles down once more to 39 tiles, which I used to build some quick environments in 3DS Max. I then knew that all of these tiles could be used and I could move on with texturing. This texturing process was similar to what I’d already textured, by using the Smart Materials such as the stone walls, ceilings, and floors, while editing any obvious tiling. I imported a new material from the Substance Share website of some wood planks by Game Textures to use for my entrance doors. I resized the texture to suit the scale of my doors, then adjusted the colour to closely match one of my reference photos, as well as adding in some bolts.
Once I finished the texturing, I started exporting the textures to Sketchfab and Unity. As one tile’s textures were exporting, I would work through the xView checks in 3DS Max for each of the tiles while I waited to save on time. As there is a maximum size limit for uploading to a free version of Sketchfab, most of my tiles were uploaded with 1024px x 1024px resolutions, while bigger tiles like the ‘three/two_story_ambulatory_apse’ and ‘stairs_left/right’ tiles were uploaded at 512px x 512px. For Unity, I exported the textures as 2048px x 2048px bitmap files. While working through this process, I adjusted settings to correct the windows in any tiles that needed updating. I checked that the Shader Settings were correct, as well as making sure there was an opacity map added to the appropriate texture set.
At the start of week 22 I finished off exporting the materials from Substance Painter to Unity, as well as uploading my assets to Sketchfab. A couple of my files corrupted the week before while exporting textures and they wouldn’t upload to Sketchfab. So for this reason, I had to re-texture the “three_story_concave_corner” and “two_story_deadend_left” tiles again, so I could upload them both to Sketchfab again. I then started assembling materials in Unity and came across a few issues. After spending one and a half working days importing the FBX files and textures into Unity and assembling materials, a window opened to say that an error had occurred while importing assets. This entirely corrupted my project, which meant I was unable to open it again. I made a mistake by not making a backup of this project, which had set me back a few days. Any future project that I work on will be backed up on at least one other device, to stop this from happening again. I started over in a new Unity project and continued to import assets and assemble the materials. By the end of the week, I was able to start applying these materials to the meshes in the scene, ready to start building the environments.
In week 23, I started by opening my Unity project, carrying on with applying materials to the meshes in the scene. I found that the project was suddenly lagging too much which was making my laptop barely usable. This happened before at university on one of the computers I was working on with this project, which is why I chose to carry on at home. I checked for Unity updates and checked my laptop for any issues but this didn’t resolve the issue. As I have another laptop as a backup, I transferred my project over to this laptop and checked for any problems again. Once again, the project wouldn’t respond properly and this meant I had spent almost two more working days on this project with no progress. The next day, I went into university to try again and project was responding as it should so I carried on with the project there. I was able to quickly catch up and started building a large three story version of a cathedral, ready to start lighting the scene and take some renders.
Although I had worked with Unity lighting before, I couldn’t get any shadows to show up in the scene. After asking my specialist tutor, he suggested making the tiles 2-sided in Unity which fixed my problem, but the shadows still weren’t as strong and defined as they should be. After asking for some more opinions, a different tutor came to help and explained what was happening in my Unity scene. I discovered that the lighting processes within Unity were a lot more complicated than I anticipated. The tutor showed me how to use the Lightmapping Settings in Unity, which is the “process of pre-calculating the brightness of surfaces in a Scene, and storing the result in a chart or “light map” for later use.” (Unity Documentation, 2019) To fix my scene, I would need to create a Lightmap and enable ‘Lightmap static’ for each tile. After this, I would then need to bake the Lightmaps which could potentially take 30 minutes for each tile. After trying this out on one of my tiles, I came to the conclusion that I wouldn’t have enough time to bake all of the Lightmaps in time for my submission date.
As well as providing useful information on lighting in Unity, the tutor also explained how I could optimise my assets to work better within Unity. He suggested I look into Occlusion Culling, which is a feature in Unity that “disables rendering of objects when they are not currently seen by the camera because they are obscured (occluded) by other objects.” (Unity Documentation, 2019) The tutor explained that I could’ve made my tiles into separate objects, so that for example, when the player is facing a pier, a column attached to the back of that pier which couldn’t be seen, would be disabled until the player moves around the back to view it. This will ultimately increase the performance of the game, by reducing the number of ‘draw calls.’ In addition to this, Unity uses Occlusion Portals, “in order to create occlusion primitives which are openable and closable at runtime.” (Unity Documentation, 2019) In the photos below, you can see examples of how Occlusion Culling works.
Another method of optimisation is to use LOD’s, Levels of Detail. This “allows you to reduce the number of triangles rendered for a GameObject as its distance from the Camera increases”. (Unity Documentation, 2019) In Unity, this means you can use several meshes representing the same GameObject with decreasing levels of detail in the geometry, which also improves the rendering performance.
Although I felt a little disappointed that I couldn’t finish building a finalised scene in Unity, I have gained a lot of interesting knowledge about the whole process and I will be more prepared for the next project that I undertake. After realising that I wouldn’t have enough time to bake the lighting into my Unity scene, I received some advice from my specialist tutor. He suggested that I could focus on building details into the nave walls, such as voussoir and capital details, as well as more contrast and weathering effects within the textures to accentuate the form and feel of the materials. To do this, I will be referring to all of my photo references, to polish the ‘two_story_open,’ ‘aisle’ and ‘barrel_vault’ tiles. These tiles can then be used together to build the nave area of a cathedral. I will be modelling a few more details and rearranging UV’s, but most of the polishing will be done in Substance Painter to improve the textures. These will be uploaded to Sketchfab, and if I have time, I will then be exporting these three tiles to Unreal Engine, to assemble materials and build a nave area to use in my portfolio, using the default lighting that is used in Unreal Engine. As I will now be spending a few extra days on these new tasks, I won’t be submitting any renders showing a variety of environments in Unity using my previous tiles, but I will be taking renders of the nave scene in Unreal Engine.
Bibliography
Game Textures (2015) “Old Planks”[ONLINE] Available at: https://share.allegorithmic.com/libraries/73 [Accessed 08/04/19]
Unity Documentation (2019) “Level of Detail” [ONLINE] Available at: https://docs.unity3d.com/Manual/LevelOfDetail.html [Accessed 12/04/2019]
Unity Documentation (2019) “Lightmapping” [ONLINE] Available at: https://docs.unity3d.com/Manual/Lightmapping.html [Accessed 12/04/2019]
Unity Documentation (2019) “Occlusion Culling” [ONLINE] Available at: https://docs.unity3d.com/Manual/OcclusionCulling.html [Accessed 12/04/2019]
Unity Documentation (2019) “Occlusion Portal” [ONLINE] Available at: https://docs.unity3d.com/Manual/class-OcclusionPortal.html [Accessed 12/04/2019]
Photo References
Nilsen, R (2017) “vezelay-narthex” [ONLINE] Available at: https://richardnilsen.com/2017/04/17/the-cathedrals-of-northern-france-part-7-vezelay/ [Accessed: 22/03/2019]
Comments