Foliage Tool (or Foliage Type option) using Landscape Lightmap

Hey guys,

I really like the feature for landscape Grass/Mesh scatter to use the Landscape Lightmap for better static lighting being projected on those meshes. However…would it be possible to expose this for FoliageTypes as well? I know this might sound weird, but I dont want to use it for bushes or trees etc…but when working on more stylized scenes where you dont need LandscapeGrass cause it doesnt need to be so lush (also, you want more control over where you place them exactly), I would prefer to place only a couple of grass patches with the Foliage Tool but still have those grass meshes pickup the lighting from the landscape.

I think if this would be fairly easy to implement, it would allow for a whole lot of freedom! :slight_smile:

Let me know what you guys think of this.


No one interested in this? :slight_smile:

Hi Daedalus,

This one is kind of wrapped up in this ticket here: Unreal Engine Issues and Bug Tracker (UE-20029)

The foliage tool instances don’t use the landscape or static mesh volume lighting samples the same way the landscapeGrasstype asset does currently. This is something on the ToDo list but just hasn’t been gotten to yet.

The feature that you’re pointing out in the LandscapeGrassType asset as actually a pull request submitted by a custom licensee that resolved the issue and allowed the landscape components to be used which got rid of a patterning problem when using static lighting with landscapes.

Hey Tim,

thanks a lot for your answer! What I dont fully understand is this though: Landscape Lightmap and Volume Samples are two different things right? So if Landscape grass samples the indirect color from the pixel of the landscape lightmap it is placed on, thats different from using volume samples am I right?

What I am basically asking is if foliage painted with the foliage tool could just sample that color value from the landscape lightmap that is at the spot where I place the object. Please correct me if I am wrong, but to me those sound like two different things.

Sorry for being a bit cocky here, but I really want to understand how this works since the reported issue, if fixed, doesnt really sound like it would do what I asked for. HOWEVER… It fixes the other problem which I guess is responsible for me asking for this in the first place XD So either way…if it fixes wrong lighting on grass, its fine…I am just asking so I can fully understand :wink:

Foliage instances sample the Volume Lighting samples that are placed. This ticket is demonstrating that issue when the foliage is set to movable. Since the foliage is cluster instances take the center point, the bounds can shift and you get the problem where the sample that is used is not necessarily in a good place to reference the VLS for accurate shading of the instances.

Here are some examples to demonstrate the ticket I linked above.

With Static Mesh (this is from the JIRA posted above):


With Landscape:


The larger issue here is probably finding a way to get these movable instances to accurately sample the area they need rather than as a whole area that shifts the center point as the cluster grows. I’m not sure the same implementation that was used for the landscape grass types would carry over and work the same for Foliage instances.

All that being said, I’m not a coder so I am not sure how the implementation is handled for landscape grass types. Seeing these are two different systems it’s likely they use a different way that wouldn’t really work for Movable Foliage instances.

Thank you so much for taking the time to explain this further! Great examples as well! :slight_smile: Now I fully understand whats going on and yeah…lets see how this shapes up in the future :slight_smile:


Landscape grass uses static lighting by finding out what lightmapUV’s landscape use under the instance and then using same lightmap. This way whole instance get just single sample but this give good enough results.
For foliage tool it could work exactly same but Foliage tool would have to split batches to landscape components size clusters.

For our current game I use similar idea. I procedurally generate grass patches over static meshes. I use ray queries to find out where to spawn foliage and from HitResults I check collision position and lightmap UV’s.

**I think having the option to use the landscape lightmap for foliage placed with the foliage tool, in addition to Landscape grass, is pretty much essential when using any kind of baked lighting. **

As it stands right now, having a large amount of foliage instances with baked lighting quickly, and unnecessarily gobbles up a huge amount of lightmap data. This is not only useful for small grass but for medium sized foliage too, as well as rocks and other meshes.

Some people might be thinking *“Why not just place those meshes as Landscape Grass?” *The answer is that for a lot of foliage placed meshes **I also need collision, **something which is not possible with simple landscape grass.

Having this option would also allow for quicker baking times since we don’t have to worry about baking thousands of bushes and rocks, etc.

Also having the option of foliage using the lightmap of any object it’s painted on is also super useful! (Static meshes, BSP, etc.)

I strongly agree to brisk1. We have this feature in the game engine from the previous project, which will save a huge amount of lightmap to get foliage look like “Witness”, but much better.
But current project use UE, and no such a feature.