Website powered by

Procedural Paving Tool - Proof of concept

That tool is more a proof of concept for me than a game ready one. It works fine, and gives really nice results, but I will see how it is going. It is situational for sure and hard to tell where it is going. But it was a great side project and our RPG project may denefit from it.

We are usually using Landscape Splines for it, which is fine, but I was curious about alternatives.

Some teaser how it looks in our project. That city I chose was perfect for testing as it had been built on a hill, so lot of imperfections on the terrain. 
Check the details on the right for some background.

Some teaser how it looks in our project. That city I chose was perfect for testing as it had been built on a hill, so lot of imperfections on the terrain.
Check the details on the right for some background.

How it works? I knew I somehow want to use a Closed Spline for that, and I found that nice tutorial by Ryan Gadz and I could use its basic logic for my tool : https://bit.ly/3eZzMeL. Definitely check it out!

How it works? I knew I somehow want to use a Closed Spline for that, and I found that nice tutorial by Ryan Gadz and I could use its basic logic for my tool : https://bit.ly/3eZzMeL. Definitely check it out!

The tool based on a point grid where we can check where the points are. I simply select the points inside, make a quick Linetrace to the Landscape and I can generate Hierarchical Instanced Static Meshes (HISM) e.g. "bricks" to the surface of the terrain.

The tool based on a point grid where we can check where the points are. I simply select the points inside, make a quick Linetrace to the Landscape and I can generate Hierarchical Instanced Static Meshes (HISM) e.g. "bricks" to the surface of the terrain.

With that tech the Spline is merely an outliner and I can place the bricks to any surface. Under a reasonable size the tool works fine in realtime in editor. Although in the city there are many points so it takes a few seconds to generate all the meshes.

I added some randomisation settings to the tool. It rotates the meshes slightly (X - Roll, Y - Pitch), and adds a random Z-offset. Those features can give a more organic look to the pavement.

I added some randomisation settings to the tool. It rotates the meshes slightly (X - Roll, Y - Pitch), and adds a random Z-offset. Those features can give a more organic look to the pavement.

Before the placement I check 4 points around the meshes for the Landscape Normals and average them to rotate the Mesh. Now I have a smoother curve. Could be better but it would have need an extra round of 4 Linetraces, so I am not sure if I want to.

Before the placement I check 4 points around the meshes for the Landscape Normals and average them to rotate the Mesh. Now I have a smoother curve. Could be better but it would have need an extra round of 4 Linetraces, so I am not sure if I want to.

Here is an issue with slopes. As the points are projected from above the angled meshes can't fill space anymore. Using the traces before I can calculate the distances to determine how I need to rescale the meshes.

Here is an issue with slopes. As the points are projected from above the angled meshes can't fill space anymore. Using the traces before I can calculate the distances to determine how I need to rescale the meshes.

I can easily transform the mesh to a square one to have a bit different look. Extra benefit : the meshes can be randomly rotated in 90° instead of 180°.

I can easily transform the mesh to a square one to have a bit different look. Extra benefit : the meshes can be randomly rotated in 90° instead of 180°.

The point grid can be triangle or square based for different looks.

The point grid can be triangle or square based for different looks.

One big issue: There can't be "islands" inside the Spline, so I added blocking volumes. Adding extra closed Splines to the tool can be az alternative, but that is for a later time.

One big issue: There can't be "islands" inside the Spline, so I added blocking volumes. Adding extra closed Splines to the tool can be az alternative, but that is for a later time.

As we are using Runtime Virtual Textures on our Landscape I drew the meshes on it. Then I set Culling on the HISM and saved some triangles.

As we are using Runtime Virtual Textures on our Landscape I drew the meshes on it. Then I set Culling on the HISM and saved some triangles.

Thanks to HISM the drawcalls are minimised and clusters of meshes has proper LOD so we can optimise the tris count as well. How performant it is? I feels really smooth, but soon I will make some A-B profiling and make an  update.

Thanks to HISM the drawcalls are minimised and clusters of meshes has proper LOD so we can optimise the tris count as well. How performant it is? I feels really smooth, but soon I will make some A-B profiling and make an update.

Just some fun :) Stresstesting the HISM components with 37150 individual meshes.

Just some fun :) Stresstesting the HISM components with 37150 individual meshes.

And for closure some in game placement.

And for closure some in game placement.

Thanks for coming!

Thanks for coming!