Download

Layered material processing and performance for landscape

Hi, I am planning to use a single layered material for a landscape instead of multiple materials for each ground type. The layered material may be “big”, as it will contain many ground types. Questions:

  1. will I have the 16 texture samplers limit even using DX11?
  2. will the performance be better rather than using a single material per ground type?
  3. when such a material is processed by the GPU, will only the branches leading to a given layer be executed? I.e. say I have a grass layer and a snow layer on top, if snow application is governed by a switch inside the material, then snow nodes shouldn’t be processed at all, is this actually the case?
  1. Nope, you can have higher sampler count, when using shared sampler.
  2. Not sure what you are referring to as single material per ground type. In UE4 you always have a single material for a single landscape component.
  3. Nope, that is not the case. Only layers, that are fully absent from given terrain component will not be processed. Others will incur performance cost, even if they are fully covered by other layers.

@Deathrey: thanks!

  1. shared texture samplers and not really discussed in the documentation. What is their scope? Are they samplers shared across all materials in the game? What are their restrictions? It would help to have Epic document this feature properly.
  2. I was mixing things up, please ignore!

For an end user, it is just a feature, that magically allows you to have high number of textures in materials. The only restriction is that they are not available on all platforms.

I made a request for Epic to document texture samplers: [LEARNING RESOURCES] Please document shared texture samplers - Unreal Engine Forums