Search Unity

Terrain grass constantly switching colors in Play mode

Discussion in 'World Building' started by unity_UZQP0eBX8RfOqg, Nov 23, 2019.

  1. unity_UZQP0eBX8RfOqg

    unity_UZQP0eBX8RfOqg

    Joined:
    Nov 8, 2019
    Posts:
    2
    Hey guys, noob here.

    When I press Play to test my prototype terrain, the grass keeps switching colors from bright green yellow to dark green. My healthy, dry, and overall grass tint are all set to white. I've tried with another grass texture to be sure the problem was somehow not my PNG but it does the same.

    Any idea?
     
  2. unity_UZQP0eBX8RfOqg

    unity_UZQP0eBX8RfOqg

    Joined:
    Nov 8, 2019
    Posts:
    2
    Really? I'm the only one that's having this problem?
     
  3. unikum

    unikum

    Joined:
    Oct 14, 2009
    Posts:
    50
    No you are not the only one. I guess most people don't use Unity's native grass system because it's so horrible bad. No idea why they don't replace it with something usable...

    Anyway if you are using Universal Render Pipeline your issue is this line:
    return half4(2 * waveColor * color.rgb, color.a);

    Inside Packages/Universal RP/Shaders/Terrain/WavingGrassInput.hlsl

    If you remove the 2* wavecolor it goes away. But it will be replaced every time you open the project and it syncs the packages. Not sure how to override it if it's even possible.

    If you are not using URP you can still probably find the shader being used by searching the project for the input file.