DEV LOG 2: LAYERING AND FOLIAGE

PROJECTBULK/BRANE

DEV LOG 2:

LAYERING AND FOLIAGE.


After creating the landscape mesh based on the height map and creating maps for multiple layers, it was time to add textures to the landscape. 

According to the mood board, The kind of landscape I have in mind is a sort of amalgamation of Icelandic Rocky and tundra landscapes respectively.


Colour Scheme

The colour of your surroundings in a video game says a lot about the genre and type of experience you’re going to get out of the world. While GTA 5 has a very realistic city in Los Santos, a parody of Los Angeles. The colour scheme of the city is very colourful with extremely sunny skies and popping colours which feel like watching a Hollywood movie. This colour scheme really enhances the experience as it really helps in exaggerating the superficiality of Los Santos, an indication to the players that this is just like a ‘movie’ and they can do anything they want. 

For my game, I want the experience to be mysterious, relaxing, calm and realistic but rare. I used ‘Coolors’, an online colour palette generator to create colour palettes. 


Even though my target is to create a dry icy landscape I also want the colours to be cool and dark. It will make the place look surreal. In my project, there are two distinctly different terrains, the icy mountains and the mossy ground. The icy mountains will have Icy rocky foliage on their surface while the mossy ground which I want to be dark green, should have subtle foliage full of light grass, yellow and red berries and flowers and alpine vegetation. The foliage should not attack the player. It should complement the world when viewed up close. 

Colour Schemes for my Landscape Top, Ground and Foliage including flowers and berries, etc.

Assets

First I start with gathering assets. Unreal Engine 5.1 gives you access to a brilliant resource known as Quixel Bridge, which is a mind-blowing library of very high-quality 3D assets, surface textures, foliage, decals, architecture, etc. The assets related to landscape painting that I’m looking for in my project can be divided into three sets, Surfaces, 3D Assets and 3D Foliage


Surfaces :

These are 2D texture maps that include a colour map, Normal Map, Roughness Map and a Displacement Map. These maps are usually jpeg or png image files and are used to Texture a 3D mesh. Colour map and specular maps dictate the colour of the objects and the way it interacts with light whereas Normal Maps are used to give things ‘artificial’ depth in their textures using smart colour manipulation and displacement(height) map is used to literally deform the mesh as per the height map.

Surface Texture Maps.

3D Assets:

These are 3D objects in Unreal Engine that include all kinds of static meshes, actors and their respective textures and accompanying files. These 3D objects can be imported inside unreal engine or downloaded through their Quixel Bridge platform.  


Contents from my 3D Assets Folder 

3D Foliage:

These are 3D meshes and texture files corresponding to grass, shrubs, trees, plants, etc. These objects will either be procedurally placed or painted across the landscape, sometimes in large quantities.  These 3D objects can be imported inside Unreal Engine or downloaded through their Quixel Bridge platform. 

Contents from my 3D Foliage Folder 


OpenLand

Now that I have all my assets in their respective folders in the content browser, I am ready to start texturing my landscape. Instead of building a sophisticated and optimized auto material for my landscape from scratch, I decided to use OpenLand by Arunoda Sursirupala. Openland is a completely customizable auto material created and optimized for Unreal Engine. It is available for purchase on the Epic games store. [1]

OpenLand Node Editor Graph

OpenLand Layer Blending nodes


If you look at the node editor graph of OpenLand’s default material. You will notice that it is very similar to the auto material I created in my first documentation. There are two different types of auto material called ‘forest’ and ‘beach’. Forest auto material is the graph that is optimised for areas with no coast and the beach is optimised for island-type landscapes. For my project, I am using the forest auto material. This auto material comes with four primary layers that we are familiar with- Ground, Mid, Slope and Top Layers respectively.


 OpenLand Megascan texture selector widget


They also have an unreal widget that makes it very easy to apply Megascan textures, it’s called the OpenLand Megascan texture selector.

The texture selector has a lot of options for applying textures. Tile near and far options allow you to resize tiles as a function of distance. Other options are colour correction, displacement multiplication, and normal and roughness map intensity. UV rotation, tint variation and The influence on texture variation from different parameters allow you to reduce repetition and tiling. 


Issues with Virtual Heigtfield Mesh

After texturing my landscape first time to add some displacement to the textures to give them real depth. In older versions of Unreal Engine, displacing the mesh based on the texture height map was done through a technique called tessellation. In Unreal Engine 5 this technique has been completely removed and replaced by another technique called Virtual Heightfield Mesh. In its current state, VHM is not too stable and unfortunately for this project, it is not working as intended. When a height field mesh is applied the terrain gets distorted and starts glitching. Hopefully, VHM gets patched in the next unreal update.

Virtual Heigtfield Mesh not working properly


Infinite Ocean

Before I start adding anything I wanted to make sure that the surroundings of my landscape are not completely empty. Since my landscape does not have a defined coast, I decided to sculpt a coast using the Unreal Landscape mode and its sculpting tools. 

Sculpting a coast using the Unreal Landscape mode


Once  I sculpted my coast I decided to add an infinite ocean and the sea around my landscape. 

To add an infinite ocean, first I had to enable the water plug-in from Unreal Engine preferences. Then select my landscape, go to details and enable edit layers. Once that is done I can add a WaterBodyOcean volume to my Unreal Project by keeping the highest point on my landscape as the target location. Once this is done an ocean will spawn in the workspace. I adjusted the height of the water body as necessary till my landscape juts out like an  island 

Adding an infinite ocean and the sea around my landscape. 


Foliage

Once your landscape has colour and texture, It’s time to put stuff in it. I have all my 3D meshes uploaded and ready to go. Since the foliage in my game such as grass trees and small rocks are not that dynamic, instead of placing them as actors in my landscape I will build a Static Mesh Foliage of the 3D mesh I want to use as foliage. Actor Foliage has the same rendering cost as adding regular Actors to a scene, but Static Meshes put using Foliage Edit Mode are automatically grouped together into batches that are generated utilising hardware instancing where numerous instances can be rendered with only a single draw call.[2]

Once I created my Static Mesh Foliage, I created a Procedural Foliage Spawner by right-clicking in my Content Browser and creating one. Then I selected my foliage and applied it to my project. 


Using Procedural Foliage Spawner to add Foliage


After the procedure spawning some foliage, there were, of course, parts of the world that I wanted to give a personal touch to. Add some variety according to height and in some crevices and corners. And give some more attention to detail when it came to foliage. Have different colour schemes for different areas with the colours of flowers, bushes and berries. To do this I used another mode of the Unreal workspace called foliage mode. This model has the tools necessary to paint and remove foliage in your landscape.


Using Foliage Mode Painting tools to add Foliage


RVT blending

After the foliage was introduced. I noticed that a lot of the foliage did not blend with my ground layer due to the differences in the textures used. There is a very cool fix for this known as Runtime Virtual Texture Blending or RVT Blending for short. A Runtime Virtual Texture (RVT) is a virtual texture that, like a standard texture map, generates its texel data as needed, utilising the GPU at runtime. Landscape shading, which employs materials that are similar to decals and splines that are designed to follow the contours of the terrain, is a suitable fit for the RVT since it caches shading data over wide areas.[3] You can use RVT to blend textures with mesh. 

RVT Blending Options for a Material Instance and Use_Openland_RVT_Tools Node in its Master Material 

To do this OpenLand has created a widget that allows you to enable RVT support in your landscape. Once you have done that you can go to the node graph of the master material of any mesh and make sure to insert ‘Use_Openland_RVT_Tools’ in the graph before the output. 

Now you have RVT blending enabled for your Foliage Mesh and your Foliage can blend seamlessly with your landscape.

Before RVT Blending


After RVT Blending


Screenshots

Next Update

Once I am done with texturing and adding Foliage to my landscape. The next steps will be to think about customizing the third person controller and third person camera angles and refining my sky box and potentially adding a weather system.


References

[1]Sursirupala, A. (n.d.). OpenLand Documentation. OpenLandDocumentation. Retrieved March 11, 2023, from https://gamedev4k.notion.site/OpenLand-Documentation-2268081d3b8e4a49a0d824a7ab0b7b44#931a91219e4944c5a2672b193ec6699c


[1]OpenLand - customizable landscape auto material in environments - UE marketplace. Unreal Engine. (n.d.). Retrieved March 11, 2023, from https://www.unrealengine.com/marketplace/en-US/product/openland-customizable-landscape-auto-material?sessionInvalidated=true 


[2]Static Meshes. Unreal Engine Documentation. (n.d.). Retrieved March 11, 2023, from https://docs.unrealengine.com/4.26/en-US/WorkingWithContent/Types/StaticMeshes/


[3]Runtime virtual texturing. Unreal Engine 4.27 Documentation. (n.d.). Retrieved March 11, 2023, from https://docs.unrealengine.com/4.27/en-US/RenderingAndGraphics/VirtualTexturing/Runtime/

Using Format