Monday, September 9, 2019

Lightbuild success!

It took all of Labor Day weekend, but subsequent testing has confirmed that the UHS: 1914 project no longer crashes when I build lighting! A technical narrative is at the bottom of this post. 

The fix involved a more detailed separation of actors to different streamed levels. One for the exterior walls, one for first floor props, one for interior static meshes, one for houses north of the building, etc. In all, the building and surrounding landscape are separated into over 30 streaming levels. As mentioned last month, this results in curious views:


The main building with interior walls and props hidden

This reminded me of how the White House looked during the renovation in the 1950s:


The Shell of the White House during the Renovation 05-17-1950
Auditorium with seats toggled off; also, walls for the main building are not loaded,
with only the wall shared by the gym remaining
To celebrate the successful light build, I decided to revisit the cement lamp poles from the front entrance. These fixtures were not actually present in 1914 when the building opened, but were installed some time in 1915, so I am justified to include them. 


Cement lantern photo reference

I say "revisit," because one of my first photogrametry attempts was to create these lamps. I incorrectly assumed I would be able to easily copy one of the sides to create the closed 4-sided figure: 


The only screenshot of the old, long since deleted lanterns from 10-22-2017. Buh-bye!
Instead, my new technique of mapping a photo onto a low-poly model, in combination with height and normal maps from Materialize, seems to create adequate results:


From left: solid, low-poly lantern model created from photo reference; same model, but displayed as a wireframe; the model wrapped with reference photo; height texture generated by Materialize


Finished lanterns, imported into UE4 with full textures. Subtle, but effective!

Getting back to the crashes, the crashes occurred during texture encoding following an otherwise successful light build. These were full crash-to-desktop situations, and according to the crash logs, I experienced over 70 of them since I first encountered it in May. The crash error was always the same: 


Assertion failed: LCI->GetResourceCluster()->UniformBuffer [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Renderer\Private\LightMapRendering.cpp] [Line: 49]

Opening "LightMapRendering.cpp" only shows on which line of code the error occured -- while the engine was trying to reference the UniformBuffer. My skill with C++ was not great enough to parse this directly, so I tried scaling down each layer by copy/pasting actors to new streaming levels until I could achieve a successful light build. As I mentioned earlier, after splitting the entire project into 30 levels, the light for the map will actually build without crashing (although it still gives a different light build error in the "messages" window following the build). 

This fixed the problem for the time being, but the error still remains. Because of copying actors from various areas of the map, there are several streaming levels that are empty, but if even one of them are active during a lightbuild, the Editor will crash. My best guess is that the old, empty levels retain some data of their previous builds, and when the Editor tries to encode lightmap textures from this data, it ends up being too big for the buffer. Without more working knowledge of UE4 and C++, this is all conjecture. 

No comments:

Post a Comment