Foliage color variation

Hi there,

For instance we have a grass patch placed all over an area, and we’d want to apply some sort of color/luminance variation on them. Not per grass or patch but for example the way we make variation into landscape surface using a macro texture. We can change intensity, scale etc. of the applied variation easily.

To explain what I mean more simpler:

Grass without variation

Grass with a cloud texture overlayd on top of the screenshot

Can we do this to painted foliage via the material/shader ? probably based on world space or something?

Just overlay a color map with a landscape coordinate set to the size of your landscape.

If this is what you mean it applies the variation to a single (bush in my case) and the same bush with the same look is everywhere. Not quite what I meant up there.

Right, sorry I’m tired.

Absolute world position -> Mask (R G) ->Subtract by landscape position(x,y) ->Divide by landscape size multiplied by scale -> hook into UV slot on your color map and then just multiply/overlay/lerp it into your foliage texture.

1 Like

Care to post a screen? :cool:

I’m not at home but mAlkAv!An posted this picture earlier:


Thank you for your time. I have a nice variation in my instanced mesh now. :slight_smile:

Looks great! Glad I could help.

It boggles my mind how everyone seems to be getting this to work, but I’m having absolutely no luck with this process.

The images I posted of my vegetation are result of doing some small change to the graph Sitrec posted.
First of all what that graph is doing is it takes the color information from landscape and blends it to the foliage that’s painted on it but I did some slight changes to fit it for my need.
For the node that says Landscape Location (X,Y) I wrote the size of my landscape 4033 for X and 4033 for Y.
And for the node that says Landscape Size * Scale it’s just the amount of tiling of that base color you see it’s connected to.
Here’s my graph I hope it helps you and if it still doesn’t work for you we would be happy to troubleshoot it for you if you post a screenshot.
Sitrec is a nice vegetation guy he’d probably get to answer you since I’m leaving now.


1 Like


I have been testing out UE4 for a couple of weeks now and been sneaking around on the forum.
At the moment I am trying to get color variation in my grass that I have painted with the foliage tool.

I have bought a pack of grass and have painted some patches of grass for a test. But I really dont undestand all of these nodes in this material and not sure how I make all of them.
Could anyone be so nice to explain whats going on in that node tree?

And some quick questions for a couple of the nodes -
The node that contains the landscape coordinates. What does this do and how do I make it?
Does it automatically find where the grass is painted? I could find much info about this.

Texture UV sample that is gray.
Should it only be a gray bitmap in this? Or am I missing something here.

These might be some really stupid questions, but all of this is kinda new to me.

Thanks for all the help!

The texture sample that is grey looks that way because it is scaled up enormously and you are only seeing a very small part of it in the sample window. It’s probably something like a PS cloud filter.

The absolute world position node samples the XYZ world space of a pixel. The mask (R,G) is discarding the Z information from that result leaving only an X and Y world coordinate that is used to modify the UV coords of a texture sample. This has the effect of creating a planar projection that can be applied to horizontal (and semi horizontal) surfaces and the texture will seamlessly tile regardless of object uvs and Z rotation.

Dividing is what determines the extents of your macro texture. In this example the value 5,000 means that every 5000 world units the texture will repeat itself in X and Y (UV)

The blend overlay node is used to add contrast and variation to the 2d texture sample of the grass. For an explanation of what happens with overlay mode see this link:

The subsurface connection is simply to help with the backlighting of the mesh.

Hi guys!
I have black and white texture for landscape.

As i understand there are shoud be black grass in black area and white grass in white area blending with albedo of the foliage from bottom to top?

Could you please explain in more detail what landscape value go for subtract and divide?