So, two weeks after I started my first challenge, I’ve finally finished my landscape experiment.
It’s been quite a journey and I’ve learned a lot. I’ve also emerged from the experience with a greater understanding of real-time rendering, the Unreal Engine and materials/shaders.
One last thing to comment on was the very recent discovery of how to improve the realism of outdoor environments (something that is quite new to me having only previously worked on indoor scenes). If you are reading this and you have everything in place i.e. terrain, foliage, lighting, materials but something still doesn’t look quite right or realistic, then consider the following advice.
Below is a video where I thought I had everything in place:
I was quite happy with the majority of how the shots looked but the final shot still looked too much like a computer game. It lacked something.
While contributing to this Facebook thread, someone pointed out that the ambient occlusion (AO) and global illumination (GI) were not implemented appropriately and that I was relying too much on shadows to define the changes on luminance in the entire scene.
This is a known problem when using only dynamic lighting. If I were using baked (static) lighting, then I would be able to control this via Lightmass (Unreal’s static light solver/baker), and a realistic look would be achieved relatively easily. Although you would have to wait a long time for the lighting to build for a scene as complex and as large as this.
However, there are two processes you can add to dynamically lit scenes to help capture some of that realism from baked lighting principles into a real-time context:
Distance Field Ambient Occlusion (DFAO) allows control over AO in large outdoor scenes, and can improve the look of foliage considerably. It’s quite complicated and (depending on scalability settings), quite computationally expensive. But it is worth it.
Light Propagation Volumes allow control over GI in a scene that is lit dynamically. Useful for both indoor and outdoor scenes, this volume (which is attached to the player/scene camera) provides improved GI in the immediate area in front of the camera. The size of the influence of the GI can be adjusted along with everything else connected to this system via a Post Processing volume that you add unbound to your scene. As with DFAO it can be computationally expensive.
The following video is exactly the same scene as the previous video expect it has both DFAO and dynamic GI enabled:
It’s worth pointing out that although the end result looks slightly more realistic, it comes at a huge cost. The scene without DFAO and dynamic GI ran at 120fps consistently. The same scene with both features applied runs at half the fps, although still providing a very playable experience.
As I set myself a number of goals at the outset of this challenge, it’s time to revisit them and see how well I met these objectives (if at all)!
1. Higher terrain definition
Well this is quite easily to evaluate as a success because I used World Machine to create the terrain which resulted in a realistic looking landscape when imported into Unreal.
I was quite happy with how the terrain looks but the landscape as a whole would have benefitted from better materials and a higher resolution.
Because my project is 100% procedurally created, I could easily generate a much more dense mesh for an even better looking terrain close up – but because of the advanced dynamic lighting discussed above, I am going to leave it set a medium dense resolution.
2. High fidelity terrain material and blending
This is a weird one. On the one-hand I am much happier with the blending of the terrain, because this was done with the aid of masks from World Machine and therefore looks more convincing, but on the other hand, the fidelity of the texture maps was only medium high (2k textures). I could have pushed for 4k but actually the slight blurring of the 2k seemed to stand up better when applied to the huge terrain.
However, once covered up by foliage, 4k textures would have been a better option because it would have allowed for better close-up viewing. But, as with the terrain definition above, given how expensive advanced dynamic lighting is, saving performance elsewhere is a good thing.
3. Better implementation of foliage
Given that only other previous attempt at a landscape used 2 different rocks for it’s “foliage” then anything would have been an improvement but I think this is biggest success of the challenge. By striving to create, place and light realistic looking foliage, I was forced to learn a great deal about the more technical aspects of working with real-time graphics.
The landscape looked ok without the foliage but with it, the scene is far more interesting and believable.
4. Blend foliage and other objects onto the terrain more convincingly
For this I had the use of Dither Temporal Anti Aliasing node in mind for the non-organic assets (trees, rocks, etc.) as this video demonstrates, but in the end I didn’t bother because there was so much organic foliage, the bases of the meshes weren’t really that visible. Still, it’s good to keep this shader function in mind for the future.
5. Make the scene look realistic using only dynamic lighting
This is a little subjective but I believe, for a first attempt, I’ve not done too badly here. I don’t think it looks as good as Eoin O’Broin’s scene he created to promote using Megascan assets in Unreal, but to be fair, his was a much smaller scene with hand-painted everything (except terrain). I think if I had created a smaller scene, I could have matched the levels of realism… but that wasn’t the main driving force behind this challenge…
6. Make each scene efficient enough to run as a game environment
… this was and I really think I achieved this because a game environment has to be explorable and viewable from every angle. You can spend a good 20 minutes exploring my environment and seeing lots of different natural compositions and everything looks consistently solid. Not amazing, but then you can’t really expect that from a totally procedurally generated scene…
7. Everything procedurally created
… which leads nicely into the final objective. The answer is a resounding “yes I did”. Aside from how well the foliage turned out, this is by far the most successful objective in my mind. Considering I didn’t have the luxury (or burden for a large scale environment) of placing meshes or painting textures, I am so happy I managed to create a convincing landscape that would take only a few hours to recreate making the approach perfect for rapid game development. Now I know the rules, the pipeline and how the procedural tools work, I could create a range of environments in a relatively short space of time. I will put this to the text in my next challenge!
BONUS OBJECTIVE: 8. Present results in an engaging fashion
In order to present the scene in an appropriate way (i.e. so the audience can see the foliage in the breeze) and in a way that allowed me some directorial control, I learned to use the Sequencer. This is a very competent multi-track inline editor that gives you incredible control over your real-time movies.
I learned from this tutorial series which also demonstrates the true power of what the Sequencer can offer.
This whole challenge has been a very interesting and enjoyable experience. I met all my objectives and produced something I am happy with. I did lose my way a little as I focused a lot of attention on foliage, but this is very much part of the overall landscape system and the things it forced me to learn will come in handy in all future real-time projects. Plus I had to put my purchase of the Megascans Meadow pack to some use!
After a proper break I’ll be back to tackle the second challenge when I recreate my Martian landscape from two years ago. Very much looking forward to being “innovative” with the foliage tools as well as stretching my existing knowledge to include weather simulation and environment effects!