[Question] Landscape Material - auto...ish?

Hey guys!

Looking for a little help on creating a landscape material …
I have LAM and a few other overly-complicated, overly-blended, landscape materials … and its breaking FPS badly for several reasons.

I have followed up reading and creating a basic landscape material, but, i am still in the dark with how to create a very basic “general use” landscape material i can toss on anything. Make some blend/layer adjustments, and have what i need. Blending 4 layers would be fine, i dont need 7 layers blended with clamps all over the place and setup in some weird crazy tess setup. As you can probably guess, this is what i have been falling into when looking at any angel based landscape materials. Tons and tons of unlabeled and “rats nests” of functions that are over-thought (process wise).

The 2 “auto” ones i looked at so far were LAM and the material from “Tropical Islands”. LAM, if anyone has looked in it … scary. Thats all, scary. lol. The Tropical Islands one is a rats nest of un-used functions tied to un-used materials. Its really a nightmare. Top it off, most of it doesnt even work (ie: grass doesnt work, layers dont make logical sense, like, why would you blend out sand and grass, then blend that into the rocks? crazy blending and illogical pathing…anyways…)

If someone could help point me in the right direction, lets say from “square 1” kinda stuff. I would rather start over my material from scratch and then follow up with a good angel based material blending. Height, i dont care about since im not looking to paint by height. I can use splats from WM2.3 but the issue is, i cant assign materials to splatmaps … can i? If i could assign grass to “this color” or “that color” on the splat, that would be amazing … using the greyscale splats that are divided into layers, i never get those to look right …

Little lost … save me! lol pretty please?

For starters, you should decide, if you really need slope based texturing. If yes, skip to the second part of this post, otherwise:

You can easily export any kind of layer weight maps out of your terrain generation package and assign textures to your layers in any way you like.
Using this approach lets you take full benefit from internal layer optimizations and physical surface ID retrieval, and lets you bypass limitations of relying only on slope for texture placement.
What is your particular problem with not getting them to look right? Typically, you would need to ensure that all grayscale weightmaps you export added together always form a sum of 1 at any pixel. The rest is up to how you arrange it in WM.
For performance, find a size of landscape component, that would balance between not having too many of them yet keeping low number of layers per component.

Part two:
If you are set on having slope-based splatting, firstly you should be aware of not being able to generate physical surfaces for separate textures(There is a workaround, but I will not cover it here. It will make programmers, working with you very unhappy :slight_smile: )

Secondly, the biggest performance eater in this case is tri-plannar mapping, typically used for cliffs. Think about skipping it completely, or at least reduce it to two projections, instead of 3, or even better, take a look here, though you might find it a bit confusing, if you are not ready to dive into HLSL. This is also applicable to relieve shader of doing layers, fully covered by other layers.

Thirdly, consider not using normal map samplers at all, for each time you sample a normal map, it gets unpacked, consuming a bit of instructions. Alone, this is insignificant. When you are reaching 8-10 of them, performance hit is already measurable.
Do the unpack manually, after all layers were blended.

Fourthly, try to minimize number of texture samplers used. Consider using something like tinted grayscale albedo maps, where practicable. Get rid of roughness maps and approximate it from albedo and normals.

Lastly, and least significantly, get rid of excess math in the material where safe and practicable. Clamps, divides, POWs etc. Try to think, what calculations you need to make for each layer, and which of them you can do once, after layers had been blended.

You can also combine using weightmaps and slope/height based painting to some extent.

As for tessellation with dynamic lighting, I kinda gave up on it until better times.
Also be sure to drop by and check relevant feature requests and topic itself.

If i could personally add a gold star to your icon thing … i would
Thanks for the write-up
The issue i have with not getting splats to work well (layered splats like grass splat, stone splat, sand, etc) is that i can never get them to blend well.
Not to over-simplify anything here …
Basically, i want to take 4 textures

  1. Sand (beaches, ocean, etc)
  2. Dirt (between sand and grass, between grass and stone)
  3. Grass (obvious, i hope lol)
  4. Stone (also obvious)

Blending all 4, of course, for visual reasons, no need for hard lines to be seen. I am already seeing i will need a height blend for at least the sand. Hmmm.
Anyways - something that will say "ok, anything that is 0-8 degrees will be “dirt”. Anything 6.8-8 degrees will be dirt. Anything from 7.4 to “whatever” will be grass and 32-90 = stone … or whatever. I can easily export my WM colors, no problem, there is a node for it. The issue this causes is that now i cant assign grass to “layer 2” if i wanted to because the map itself is covered with a giant picture, instead of layers.

In the end, of course i want it to look great, but, performance is really what i am looking for. Would you say using WM export with layer splatmaps would be the best option?

I don’t really think the case you described is worth investing time in developing automatic material.
I did not work with WM a lot, apart from trying demo version, but i’m sure you can use slope selectors to get 4 masks for specific angles as you described, pass them through splat map maker macro(or manually subtract the masks between each other) and export 4 of them as 4 separate grayscale images.
To get nicer blend in your in your material, instead of using LandscapeLayerBlend node, try using material function for each layer. Then blend them consequentially, using HeightLerp with two heightmaps material function. Use LandscapeLayerSample node as alpha input into the HeightLerp.
Stone->Grass->Dirt->Sand

There was a content example, the one with snowy mountains and a glider. You could investigate it a bit.

perfect! i shall do this! thanks so much for the help!