1
$\begingroup$

I have grass on my terrain.

enter image description here

The terrain is textured by a single Image texture which is simply dropped onto the terrain.

The grass is created using a hair particle system.

How do I make the grass take on the colour of the terrain below it? For example, where the terrain is white I'd like the grass to be white, where the terrain is green I'd like the grass to be green, etc.

Below is my terrain shader setup. As you see it's as simple as it gets.

enter image description here

$\endgroup$
4
  • $\begingroup$ is your terrain made of an Image Texture or is it procedural? $\endgroup$
    – moonboots
    Commented Jan 28, 2021 at 9:34
  • $\begingroup$ Does this help you? How to add a texture to the emitter of a hair particle object $\endgroup$
    – Blunder
    Commented Jan 28, 2021 at 10:36
  • $\begingroup$ @moonboots It's quite literally an Image Texture, there is nothing procedural about it. $\endgroup$
    – Joehot200
    Commented Jan 28, 2021 at 10:41
  • $\begingroup$ @Blunder Actually that helps me quite a lot. If nobody beats me to it I'll add an answer later in the day once I have it all figured it out. $\endgroup$
    – Joehot200
    Commented Jan 28, 2021 at 11:29

1 Answer 1

2
$\begingroup$

Copy the shader you used for your terrain onto your grass, but use "object" texture mode instead

Final result: enter image description here

Terrain shader: enter image description here Grass shader: enter image description here

While you could choose to apply the terrain texture directly, I chose to multiply the original grass texture with the terrain texture. This way, the grass retained it's colour but would be lighter where the terrain is lighter and darker where the terrain is darker, as seen in the image above.

The best way to experiment is to make a plane and use your grass shader on the plane to check it matches up with your terrain. I had to tweak the texture coordinates quite a bit.

Before: enter image description here After: enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .