Search Unity

Question Trying to get 'even/flat' lighting on stylized grass.

Discussion in 'General Graphics' started by MechaWolf99, Sep 2, 2020.

  1. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    294
    Hello,
    I am trying to make some stylized grass. I am using the Amplify Shader Editor for the grass shader. The style I am trying to go for is where the grass is 'flat' and has no lighting of it's own, but still receives shadows.

    I have a grass quad that I have rotated the normals of to point up. The problem I am having is that when the grass plane is rotated at an angle, it has different lighting, darker/lighter. This is easiest seen at the bottom of the attached image.

    The shader currently is basically the default shader, but with out any face culling.

    Here are a couple of examples of the style of grass I am trying to get.


    I have been googling for several hours, but not having much luck. I assume it is some small thing I am not realizing. Any help would be appreciated.
     
    GilbertoBitt likes this.
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Use the up vector to compute light instead of the vertex normal
     
  3. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    294
    Oh my gosh! So I had seen that while googling. But when I tried doing it I did it wrong so I thought it didn't work. After reading that I went and did some more googling on the subject and got it to work. Thank you!

    In case I forget, or someone else happens to come across this. This video is about doing custom lighting in ASE, and had the needed information on how to set it up properly (specifically at around the 10 minute mark).
     
    GilbertoBitt likes this.
  4. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111

    i'm dumb but has a programmer i will try too! idk much about share so giving a try in this could be fun.