Download

Grass Material Lighting Problem

Hi guys, I know this is probably asked loads, but I’ve had a good search all day, and can’t seem to get this right.

My grass is improving, but I really want to perfect it this time.

So my main problem is the way it’s lighting currently, I can get it to blend nicely with the ground texture from one side, but the other side it’s really dark.

I’ve tried messing around with SSS & even that Fuzzy fresnel shader (didn’t help).

Here’s some images of the grass from opposite sides:

GRASSLIGHTINGUE4.jpg

https://dl.dropboxusercontent.com/u/62238920/Grasslighting2.gif - A Gif illustrating it better (50mb)

Also does anyone know any other tips and tricks for blending the grass with the terrain texture under?

This has always been a problem.
People do different things to get around this.
To my experience, the problem comes from both landscape material and (sometimes) the grass material.

The UE4 documents say that you should not use a specular map for non metals. Well until your geometry doesn’t have millions and millions of triangles that statement is wrong and you should use a specular map. A specular map will compensate for all the tiny holes, cracks and things like that on the surface where it’s actually having a little depth and is not reflecting the light directly to your face like a mirror would do. Generally it doesn’t make much of a difference but when it comes to landscapes it shows the error very clearly.

Second issue is that you should then adjust your grass specular to match the specular on landscape. Activate specular view in the buffer to see better. Then also make sure your grass SSS isn’t very high because landscape doesn’t have SSS and so while the light makes the grass look brighter on the opposite directions, your landscape brightness doesn’t change. Usually using the base color as SSS without increasing it’s intensity gives the best result.

I don’t have any specular on my grass at the minute because it looks terrible with any, also when I do plug some spec in it lights a completely different side of the grass, not the problematic “dark side”.

I don’t think my dark side of the grass is a specular issue :frowning:

EDIT: I’ve noticed that the “dodgy” side is the “two sided” side, being the other side of the planes that the shader is creating and it’s obviously not lighting properly because of the normals?

Anyone know a workaround for this?

EDIT2: I’ve found the solution, it’s the dodgy backface lightning because planes are only one-sided, so it’s to do with UE4’s two-sided lightning, simply multiply a “twosidedsign” node with your normal map (or a 0,0,1 vector3 if no normals) and plug into normal.

Grass normal should point upwards from terrrain surface. Just test this with wordspace up. Material attributes should be about the same as landscape. So try to replicate base color, roughness and specular of landscape. If you are using static lighting then you should check “use landscape ligthmaps” toggle. With these settings you get perfect looking grass.

Yeah don’t worry I fixed it, my normals were facing up, the problem was my two sided normals weren’t lighting properly (because of how unreal replicates the backface normal I guess).

“TwoSideSign” Multiplied with normals or a vector3 set to 0,0,1 fixed it perfectly.

36513be7200d823b8cbcb0137cc1ac7aaa511b46.jpeg