Hello I did a script that create a day/night cycle for my world. for that, my script change the values of colors of the light, the fog color, the fog density, the ambient light, the color of skysphere, the clouds... looks very good in game, but a litle detail need some attention The grass stay at the same luminosity... for the day time, is ok, but when is night time, is like illuminate grass ^^ So i tried to find a command that permit me to have access to this grass color, and i find nothing... does somebody know what sort of script command could touch the grass color?
Are you saying that the grass stays the same bright colour even when the scene lights are at a low level? If so, you probably just need to use a different shader on the grass material (say, one of the Diffuse ones). If this isn't what you want, you can access the material's colour using renderer.material.color and set it to anything you like.
well, i tried to change the intensity of light form the only light in the level, nothing change in grass. I look in the shader of the grass, in project pane, and is the texture importet that appear, with no place for the shader, and in the hierarchy, i can't change that because is in the terrain script, and is no place for shader in terrain script. So for the script line you give me, is the same, i don't know how to target the grass with a script if this grass is in the terrain sctipt...
As i know, it is not possible to access to the grass color with: renderer.material.color only... if she is in the terrain script. For change manualy this color, i need to select it > edit grass texture, and appear a window. So in the command more up, i need to precise in the script how to access to the renderer.material.color of the grass that is in the terrain script.
have you tried to make the surface of terrain not in Unity? try with Vue or Terragen. then you can paint it
Yes, the grass tint property doesn't seem to be accessible, or at least nobody seems to know the variable name (though breaking the API might not be such a good idea). As far as I know, only trees and detail meshes can have light sources affect them. All grass is permanently stuck on the same tint color. Night day cycle with terrain grass = impossible as far as I know. Well, at least if you want it to look good anyway
I would guess gras uses the lightmap color for performance reasons, so you could experiment with tinting that.