Grass Shader

Hello guys. I setup a grass. But it lighting have a problem. It don’t get any shadow or lighting from the world. Any idea what might be wrong?
Thanks.

Hey melechesh,

I have a few questions to help me narrow down the cause of the issue.

  • Did you paint the grass mesh using the ‘Foliage’ mode, or were they manually placed as individual static mesh actors?
  • Would you mind providing me with your Directional and Skylight actor light settings (e.g. mobility, lighting, etc…).
  • Would you also provide me with an image of the material you are using for the grass mesh itself?

A quick way to test if they are casting or receive shadows would be to set your Directional light actor to ‘Moveable’. This will ignore any baked lighting and produce fully dynamic lighting and shadows.

Thank you,

. I use a Foliage mode
. Directional sun light is set to stationary (More options are in snapshot)

I have a problem with Directional light set as dynamic. I dont get any GI. i read this doc [link text][1]

But i dont get any GI.
Is (Affect Dynamic Indirect Lighting) the same as (Dynamic indirect lighting)? Its name changed?
As you can see in the snapshot, now current issue is that grass in not casting any shadow, but it get shadow

Hey again melechesh,

Do me a favor and try plugging in the final result from your simple grass wind directly into the World Position Offset.

Then multiply your ‘Vertex Color’ by the Texture sample you are pulling from the red channel, and plug this into your ambient occlusion input.

Let me know your results after testing out these suggestions. I would also check to make sure your static meshes LOD’s are set up to cast shadows at the correct distances.

Thank you,

Thanks. I did what you said. and here is the result. Btw i changed directional light to movable and now grass have a shadow. However with stationary grass dont have a dynamic shadow. But if i built with directional light as movable, lighting goes wrong. So what i ended up is to built with stationary and then switch to movable. I am not sure if its a correct way or not.

Hey melechesh,

When you switch your directional light to movable, You are using full dynamic lighting and shadows (nothing gets baked by lightmass from that light source).

I noticed you have ‘Cast Static Shadow’ ticked off for your grass foliage. This is probably why, when you switch your directional light to ‘Stationary’ it is not casting shadows after rebuilding your scene.

It seems like you might need a bit further understanding on how Lighting and Shadows work based on light mobility types and other variables. You will find the documentation below very helpful and informative in regards to this information.

Rendering - Lighting and Shadows

Let me know if you still have issues or questions once you have completed the suggested steps and read through the documentation.

Thank you,

Thanks. I read this doc before. If i set ‘Cast Static Shadow’ to ticked on in Stationary mode, engine will bake a static shadow, but grass is moving. It seems there is a conflict here and engine can not handle grass lighting correctly. Grass is moving, therefore it must cast and receive dynamic shadow in Stationary mode, but its not.

Hey melechesh,

Your grass is actually not physically moving in the level itself. The material is simulation movement through the ‘Simple Grass Wind Node’ in your material set up.

Set the grass to ‘Static’ (if using a Stationary Directional Light), and be sure to enable both Static and Dynamic shadows for your foliage grass mesh and your light source. Rebuild your scene and let me know your results. This should resolve the issue. Keep in mind the Skylight also plays a role in casting shadows.

Thank you,