Small clutter, best practice?

So, I’ve been building a fairly huge terrain, and have populated it with tons of larger stuff.
I’ve been experimenting with a decent way of making small clutter work and figured I should ask the community about your experiences.

Since my map is fairly large (around 13 square km), adding small clutter would quickly add up to millions of items and I’m worried to go with the wrong approach.
At the moment I’ve populated it down to grass, but my grass meshes are fairly large, and very lowpoly.
The problem I’m having is that areas without ground covering grass is that the landscape** looks very flat** despite good normal maps on each layer.
Therefore I should go one step lower and start covering with smaller rocks, twigs and stuff to make the ground look more realistic.
I’ve been experimenting with different approaches back when I worked on this in UDK and never really figured out the best way to go.

What would you say would be the best way of doing it? I want as cluttered ground as possible with the least amount of **performance **hit (obviously).

Back in UDK the foliage mode used to get slow as hell when too much meshes had been added so I had to split my world up into tiny pieces to get more than one instanced foliage actor and then stitch them back together. But this doesn’t seem to be an issue in UE4 (I’ve placed around 600 000 trees without any lag what so ever in the foliage tool so I’m positive.

So I have a few different ideas on how to add clutter:

1.
Either just make **individual **small, low poly rocks and stuff and then paint with foliage mode, or make meshes that contains a cluster of stuff that then can be painted with foliage mode.
Then set them all to very low culling distance and make big foliage clusters with tons of meshes that are instances of each other.

Would this work for covering a few square KM of landscape? And is there any benefit of making meshes with more than one tiny rock vs just painting **individual **ones? Since they’re instances of each other I’m not sure since there shouldn’t have to be more **drawcalls **as long as they’re clustered in foliage mode correctly, right?. They’ll of course have LOD levels that switch fairly close to the player.

Also, exactly what does the instancing of foliage do? Does 5 trees placed that are all instances of the first one in the cluster equals the same performance hit the first one causes? I’m guessing it doesn’t since they all receive light and cast shadows differently but would like to know how big of a difference it does?

2.
A second approach would be adding **tesselation **to a few layers in the landscape material, I’ve tried this with pretty good looking results but obviously fairly big performance hit. Would this work as long as I fade out the tesselation so it’s only used pretty close to the character?

3.
Back in **UDK **myleslambert, CobaltUDK, evernewjoy and a few others put together a system that spawns smaller clutter in runtime here: Runtime Foliage - Epic Games Forums
Would something like that be a better approach and, maybe build it using blueprints? Any ideas on how this could be achieved?

Playing Arma 3, I’ve noticed that they have ground clutter that seems to be part of the terrain, it doesn’t look like individual meshes, more like tesselation but they have collision so I’m guessing it’s actually part of the ground geometry? or how do they do it?
If it’s part of landscape(terrain in their case) geometry It won’t be doable for me as my 4033 landscape resolution isn’t enough for such small details.

Thanks in advance!

I’ll go ahead and bump this.

Those are definitely the options, for things like rocks instead of single rocks I would do clusters, you can still get a very low poly count for it and it would be easier to manage. Tesselation is also an option, and you can set it up so that it will subdivide less for things further away.
I’m not sure which would perform better, perhaps tesselation since the graphics card is optimized for that. But it’s hard to know.

Hi Sitrec,

I’ll give you some pointers with some of the things below to get you started.

This is the best option. Make some small rock/debris meshes that you can paint with the foliage tool. This will be the most efficient way of handling this. The foliage tool allows you to paint your objects onto a surface with a density you can specify. If you’re using a dynamic light with dynamic shadows you’re performance hit will be there. If you’re using static shadows you’ll not see a performance hit since the shadows are getting baked into a lightmap.

Using tessellation on landscapes is not recommended unless you like the land of spikes. :slight_smile: Tessellation does not work on Landscapes.

You could possibly do something like that with BPs by having the mesh spawn in and grow like that. It’s possible but it would probably take some research and testing for you to get something you would like.

I’ve search and looked at several of the images with terrain from ARMA 3 and from what I can see this is just a landscape that is using a Normal Map.

If you have any issues feel free to ask!

Tim

Thanks Tim and Darthviper107!
It’s so great to be able to get answers from epic and other experienced users on topics such as this, that isn’t covered much in documentation, really appreciate it!

I’ll go with making rock clusters for use with foliage.

I’m using dynamic lights though, would that change anything or is this still the best approach?

I also though Arma 3 used normals at first until I inspected closely and noticed that they actually have geometry, but they looks like bumps in the landscape so somehow they probably have a heightmap that matches the other layers to get the stones to rise.
Wouldn’t work for me since I have too low landscape resolution for that though.

You’re best option would be to use a Stationary lights which is a cross between using static lights and dynamic lights. For distant shadows the shadow information is baked into a lightmap then when you get closer it’s handled by dynamic lighting. If this is something that works well for you give it a shot. Test out some different versions in a small scene and see what looks best for you.

If you have any questions feel free to ask! :slight_smile:

Tim

I’ll try that, thanks Tim!

-Tom

My understanding is that static lighting hasn’t been implemented for instanced static meshes (the roadmap currently has it as wishlist/backlog). Is there a way to use the foliage tool and not have them be type InstancedStaticMesh?

Hi Opticol,

You are right that at the time I posted that, it hadn’t been introduced into the engine yet.

With 4.3 this feature will now be included. You can see we’ve enabled the check box to enable static shadows for foliage.

Thanks,

Tim

I just squealed. Thanks Tim!

-Chris

To add to this, I think increasing your Clustering while painting foliage would help as well. I think it defaults to 100, but doubling that might help… looking at the picture Tim posted, yup, it defaults at 100 :slight_smile:

Haha Glad you’re happy about that! We’ll be releasing the full 4.3 here soon with a full list of details with the release notes of all that is included. Some great new features this go round!

Tim

Yep there sure are. I converted our project over to 4.3 and saw a GREAT performance gain. Switched the shadowing over to static…but sadly found out that InstancedStaticMesh doesn’t shadow other InstancedStaticMeshes yet (this also means no self-shadowing!) Just a caveat for anyone following this thread.

Thankfully I think the performance gain may negate our need to switch to static lighting.

Yeah definitely, and if I recall correctly (someone mentioned it back in UDK days), make sure to follow power of two when it comes to clusters to conserve the amount of lightmaps needed if you intend to use static lighting.