Jump to content

[SOLVED] Grass shading doesn't follow terrain shading


photo

Recommended Posts

post-1189-0-10271300-1383065740_thumb.jpg

 

So I tried adding grass, and the result is less than spectacular. The problem is that the grass shading doesn't follow the terrain shading at all. There's very defined hills with totally flat shaded grass growing on them. This becomes a very ugly problem when looking at dark areas of terrain and the grass looks radioactive. Is there a way to fix this?

 

I have receive shadow and receive world shadow both checked on my grass and terrain, for both the nodes and materials. Pretty much everything is set up like the "Adding grass" tutorial in the documentation.

Link to comment

Grass material has a special 2d noise texture which can be used for color modulation:

half3 noise = texture(s_texture_1,s_texcoord_0.zw).xyz;
diffuse.xyz = saturate(diffuse.xyz + (noise * 2.0f - 1.0f) * noise_scale);
The noise texture coordinates can be mapped to cover the whole area of interest.
Link to comment
×
×
  • Create New...