Foliage + Lightmap increase 'mesh draw calls'

Hi everyone,

Our artists are using foliage tool to paint our forest level (place lots of grass, trees…), but we have some performance issues.

Before we place these vegetation by foliage tool,we get a suggestion that using dynamic lighting instead of static lighting. In our scene, we have a stationary directional light, a stationary skylight and some point lights, we also set grass and trees as ‘movable’ to avoid been baked into lightmap. but the result is difficult to understand.

  • Before building light ‘mesh draw calls’ is about 1k and ‘static list draw calls’ is 800.
  • After building light ‘mesh draw calls’ increases to 20k and ‘static list draw call’ is below 100, it decreases performance and we are bound by rendering thread.

From my knowledge, foliage instanced mesh draw calls are counted as ‘mesh draw calls’, because it’s instance, it should not increase draw calls, it‘ a little weird that it seems like after building light, foliage instanced meshes become normal static meshes that brings the increase of ‘mesh draw call’.

My question are why we should use dynamic lighting for foliage instanced mesh? What cause ‘mesh draw calls’ increasing to a large value after building lightmap? Does foliage instanced meshes support culling (frustum culling,occluded culling)?

We are relatively new to UE4 and we are wondering if someone here can answer these questions or give us some advice on foliage.

Any help will be most appreciated.

  • Firstly, I think you would benefit
    greatly from using landscape lightmap
    for undergrowth.
  • Secondly setting your foliage to
    movable might break batching.
  • Thirdly, If you are already using
    static lighting in your scene, there
    is no reason to use full dynamic
    lighting for foliage. The only reason
    would be if you are trying to render
    a large outdoor forest scene. If
    thats the case, lightmapping
    thousands of trees would be out of
    option for both runtime memory
    reasons, and baking times.

Thanks for your quick answer. I did a quick test, movable foliage static mesh won’t increase mesh draw calls, because they are still instance.

Our scene is large and use foliage for a large area, through GPU Visualizer, I find ShadowDepthsFromOpaqueProjected
→ PreObject InstancedFoliageActor takes a lot of time, does it mean foliage actor is too large (contain too many meshes) ?