Procedural landscapes or landscape materials or foliage

Hi never tried this , just wondering how it works , i mean as far as i understand this would populate certain layers on the landscape with say grass , or trees or rocks even . So with the grass say or trees, does it then auto populate the whole map this way? And if it did , then what if you want to put a town or something where the grass is ? what happens to the grass and trees in that area where you put stuff ?

Depends on how you build it, and using what.

The landscape grass material node for instance, would need a layer subtracted so you can paint a “no grass” layer where you need to remove it.

The procedural tools have blocking volumes to stop growth in areas. Though they are still flagged as beta, these work well enough.

Like the grass, the landscape material will usually have an automated layer and the same layers flagged as layer’s you can manually paint.

If you are generating a full landscape at runtime procedurally you are always composing it from heightmaps.

Assuming that, you can skip auto materials and just associate slope maps to paint the material layers. (Because auto materials can be heavy).

Not many games out there generate the terrain procedurally.
stuff on the terrain - depends on the game.
Most thing use BPs or a replacement system so you can chop trees/modify the landscape…

Ok , it seems most of the marketplace assets have a foliage removal layer as far as i can tell . What are “slope maps” ? Are you saying with these you can just paint and it will put the correct materials at the correct slope? I am figuring on using a map of about 4033 x 4033 overall , and i noticed playing around with them that if i just paint regularly on them , FPS will stay around 120 on an empty map , but if i add automaterial , it can drop to around 55 to 60 just with the automaterial. , but it can be hard to paint everywhere you need to correctly on a mountainous map . The procedural foliage , will this work with world composition? I mean will it spawn across all tiles correctly? I made a huge level once ( around 8192 x 8192 ) , and put tons of mesh’s , cities , all kinds of things on it and it was all good , till i put foliage on it , then after enough was on there , it locked up like a siv. But i wasn’t using world comp on that map either.So i am trying to figure the best way to do this for a mostly open main landscape , though some areas like caves or something (like indoor type areas, i suppose i could use open level bp and treat those as separate.

You can then just isolate things in the raster the script produces. Usually on large data sets you also cut it up into tiles before exporting. The concept is the same though.
It’s a pre-calculated black/white image that is used to define the paint layer the landscape takes.

You have to set it up when you do the tile import. You have options to select the paint layer file.
You’d use the appropriate tile set for the appropriate layer and once the import finishes the landscape comes in with the correct layers painted.

I ended up creating instances of the spawner on a per-tile basis. You want tiles to be as isolated as possible for performance. You need to be able to LOD down into static meshes at a distance.

It does work across tiles. but it’s not going to allow you to cut the instances out if you stretch it across multiple tiles.

Fine-tuning performance to automation is also more of an art that you won’t find tutorials about. Takes time, patience, and fighting against the engine’s windmills…

Thanks i will check the link . I never used world comp before , when you place foliage instances or even static meshes in the tiles , do they automatically stream in and out as well ? Like the landscape?

“I ended up creating instances of the spawner on a per-tile basis. You want tiles to be as isolated as possible for performance. You need to be able to LOD down into static meshes at a distance.” , … The thing is there seems to need to be a **** load of tiles on a bigger map , sounds like a chore . One thing i noticed is with the streaming distances in WC , there can be a lot of pop in. Its kind of jarring when all of a sudden a whole mountain pops up in front of you.

for starters 8KM size is your friend - despite being hard to optimize.
second. Usually the tiles are all the same size, so the process is easy to automate with AHK or any other similar script system that let’s you set up mouse movement/keyboard repetitions.

that’s probably just because you don’t have any actual impostors setup.
a proper landscape will usually have very distant tiles replaced by meshes. Popping between the mesh and the tile is minimal.

When you put mesh’s and foliage instances on the different tiles , do they automatically stream in and out with the landscapes? And does this always have to be done in a tile that you " make current"?

Usually I open tiles individually and work directly into the level.

as far as streaming. Its probably best to separate the landscape and the foliage meshes when generating the LODs.

And/or to bake the foliage into the landscape texture.
how well that works really depends on distance.

When you need to have meshes present because the terrain is flat or you need a long distance view (which normally transitions to billboards) baking all the instances down to a single one is your best bet.
actor merge can work on it. And you just need to move the created actor into the impostor level, which contains the mesh.

Is there any tutorials or docs that talk about imposter levels and baking stuff in?

What is a splat map ?

not really. best best can find is how to bake down the map. I haven’t seen anything covering vegetation or how to convert from levels to aggregated HLOD to reduce draw call count.

Essentially the same thing as a slope.
just from world machine instead of Qgis. The algorithm to generate it is much the same…
In essence, you look at 3x3 pixels to detrmine the inclination of the pixel at the center.
Once that data is written (which the qgis slope tool does) you can pull out isolated maps to color the landscape based on the inclination. Something like Rock above 60°, mudd between 30° and 60°, and grass below 30°.

One possible exception to the term, I suppose:
A large texture that spans the landscape tile UV and provides color information which can be utilized across other assets for blending.
I wouldn’t personally call it a splat map, but I know some do.

That helps , thanks. So how about this , with world comp map , is there a certain way to use a procedural spawner ? I tried to spawn some trees on the world comp map , but nothing appears in the volume . The trees are a foliage spawn.

One other thing , how do people handle it when , say , you got trees with billboards on a world comp landscape, and so if the landscape is streaming at 50,000 or even 100,000, then there are times when in the far distance , the landscape is not there since its too far to stream , but the tree billboards are still showing trees and it looks like the trees are floating in air?

For both questions:
usually you work on the tile itself, not in the persistent.

Each tile has it’s own procedural spawner that gets loaded in.
this also addressed question 2. If they tile is not loaded, the trees aren’t either.

At best you can make some sort of aggregated billboard impostor by duplicating the produced assets and merging the actors with actor merge after forcing them to the billboard LOD.
this could be done to reduce the overall number of drawcalls and its usually never procedural. Meaning it’s a fixed actor. You can’t change what was merged at runtime.

On the other hand, just having less trees overall is likely a better solution even if unrealistic.

You need to decide what you are making, and for what system you are making it.
based on that, there are hard limitations on drawcall counts, distances, number of verts, etc that you can use to populate the scene.

If you are attempting to recreate reality for a game, forget it until quantum computing is a thing. Maybe by then we’ll be able to have the required amount of instances.

Until such a time, plan ahead and look into engine specific optimization practices for foliage.
Like Ryan Bruck’s impostors to mention a quick one.

Ok thanks , so your saying that if i work in any particular tile and have that as current , then any actors placed there in that current tile, like trees or buildings say , will also stream in and out with the landscape that the world comp distance is set to? ( something i still don’t understand about how world comp exactly works , that if static mesh actors placed would also stream in and out according to the world comp streaming layer assigned) , I mean , otherwise it would seem that one could have the same issues with buildings or other things placed like the trees , where then the building would be like floating in the air as well).Or are you saying that if i use a procedural spawner for trees in the current tile , then the trees will work and spawn and then despawn along with that tile?

This is what i mean , where those tree billboards back there look like they float because those landscape tiles are not loaded.

If they were part of the tile, then they just wouldn’t load in at all.

also, obviously you need something to show at that distance anyway, in terms of land. That’s where landscape impostors come in.

When you bake them, the engine automatically produces a level that contains the simplified mesh to steam in.
To access those you definitely have to load the level separately.

Yea , i made a section back there current , then painted some trees on it , and so then the trees dont load when the tile is not loaded :slight_smile: . How do you make imposter level so something shows in place of the landscape? Is it difficult?

it’s a hidden tab inside the level view.
The colors will almost never match because of the process. Roughness/specularity being different. What I ended up doing is making a master material and slowly, tile by tile, replacing it with the correct material instance, so I have control over it.

To access it, you need to set the number of LODs to something other than 0, and play with the settings to generate it. The distance is perhaps the most important one to keep in mind.
In world composition you assign distance via Layers.
Different projects, different strokes. Tile size (8km vs 2km) would probably drastically alter the distance at which an impostor is needed.

In fact, you may want to base that on the overall map size… picturing yourself on a corner How many actual tiles should you see? (Hint, for performance 1).