Procedural Landscape Layers

Does anyone know of a way (or is it even possible) to procedurally generate landscape layers instead of having to paint them?

At the moment, I have a landscape material that will automatically paint the enter landscape based on various algorithms I’ve created in the material and sampling noise textures to produce masks that I use to lerp between different textures. This works great and has painted the landscape just how I need and automatically updates as I change the landscape or create new ones. The issue though is that there is no landscape layer information baked into the landscape as I haven’t “painted” it with the landscape painting tools like you normally would. Essentially, I’m creating these paint masks procedurally, but I have no way of accessing them outside of the landscape material.

This now becomes an issue when I try to use PCG as it can sample the landscape and extract information such as the landscape layers. This is useful for then spawning procedural content (like trees) on certain layers and such. But unfortunately, I don’t have this information to sample. So, I’m wondering if there is a way around this? Can I generate this information somehow or is there some other way in PCG to determine what the ground type is on the landscape (i.e. grass, dirt, etc.).

For now I’m just using the landscape grass layers system as I can feed my generated masks into it in the landscape material. This works fine, but I would love to find away to get these masks over to PCG so that I can do some more interesting things. Any ideas?

for shure there are “plugins” in fab cause I downloaded one and never used, un ue5 presentation they even showed a similar funtion

Hi, you could at least bake them out. Won’t be fast to iterate though. You can let the landscape write to a Runtime Virtual Texture, and write out your masks to it, either one by one or three at once (RGB). Then create a streaming virtual texture from the runtime virtual texture (button click in the settings). Then export the streaming virtual texture which will give you those masks as image. Then you can make them into individual grayscale images and resize them to the size of the landscape, then import them as landscape layer. Repeat until you have all your layers.

The landscape setup in a “dynamic" way will not work at runtime (on a published game) - so don’t waste time on it.

Whatever you come up with would have to use actual textures and be built for deployment if you use the epic sorry excuse for “landscape" system.

Instead, you can levarage some voxel plugin or any other Items you may find on the marketplace that are created to work at runtime.

Performance will vary - landscapes done wrong account for about 90% of extra scene costs in projects.

Finding a pre-made system that works and takes performance into account without extra work is pretty much the equivalent to the search for the holy grail - only, you are always the nazi in riders? :laughing:

Be aware that PCG should work much the same - it precomputes and sets the positions of objects so that all of the instances end up stored and baked via their transform. A game running will not automatically adjust said positions.

Realistically you would need to come up with a way to place meshes at runtime if you plan to have things change at runtime - and that will require you to have some sort of a loadong screen and a 30s or so loading time at a minimum (depends on instance count).

It’s not impossible, but you can’t levarage PCG afaik.

Last thing worth a mention - the trash unreal peddles uses a simple 16bit grayscale to generate the terrain - known as heightmap.

Normally, you process a heightmap in some other program GIS - and extract a slope map to do the painting and placement of stuff from.

You could levarage the same setup to make changes at runtime, many systems work that way - just not epic’s.

(post deleted by author)

Thanks for all the feedback guys. I have thought about just exporting the masks to some maps I can use in PCG, but was hoping to find a more dynamic way to speed up iteration time. I’m not looking to do this stuff at runtime or try and generate landscapes at runtime or anything like that. By “procedural” I just mean in-editor stuff to help me speed up the creation of my landscapes and placement of foliage and such with a consistent look and feel rather than having to try and do it manually by painting in the landscape layers and the foliage by hand all the time.