Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Shader] Moving Trees Grass in Wind Outside of Terrain

Discussion in 'Assets and Asset Store' started by AustinRichards, Feb 26, 2014.

  1. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    44
    Anyone able to convert this shader to work with the new SRP? tried to work around and edit the shader but still cant get it to work with the lightweight render pipleline .
     
    Ozer_Jigme and DonJorris like this.
  2. colijn

    colijn

    Joined:
    Aug 1, 2018
    Posts:
    4

    Do i just create a new c# and delete everthing inside it and then paste one of your scripts on it?

    Ive tried that but it didnt work

    How do i get it to work?
     
  3. Will-D-Ramsey

    Will-D-Ramsey

    Joined:
    Dec 9, 2012
    Posts:
    221
    Im trying to adjust the shader so it doesnt move the very bottom of the mesh. This is so the base of the grass or branch doesnt move, since it doesnt irl. Ill keep trying but im new to shaders and any ideas would be greatly appreciated.
     
  4. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,201
    Hello Sarah,

    thanks a lot for your Version of the shader. I tried different grass shaders, but this Version is for my usecase really great.

    I just have one Question, Maybe you can help me with because I am not a shader expert:

    I am using a textureatlas for different grass textures, I have 8x8 textures on one atlas.

    For each grass I have an own mesh with some simple planes, that Point to the desired part of the Atlas for different grasses.

    With your Version of the shader this Looks really perfect on some of them! But some move extremly strong now, others do not. Can you tell me how to get them all move the same, so having Kind of Modulo calculation for this depending on the width and height of a part or the number of colums and rows?

    Can anybody add this to this Version please? That would help me a lot!

    Thanks :)
     
  5. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,201
    PS: I tried to Modulo the part with the Texturecoordinates but now it does not move/shake at all anymore. I have 8x8 grass textures in my textureatlas.
    float waveAmount = fmod(v.texcoord.y, 0.125) * (color.a + _ShakeBending);

    And I just realized the grass does not set a shadow?


    -> works better with v.vertex.y. I guess I can find a solution with that, thanks!
     
    Last edited: Mar 21, 2019
  6. briancullen13

    briancullen13

    Joined:
    Apr 3, 2015
    Posts:
    3
    We are trying to figure out how to stop the sliding of the base of the sprite in play mode - seems to be anchored in the editor - did you have any luck?
     
  7. RR7_

    RR7_

    Joined:
    Jan 9, 2017
    Posts:
    75
    has anyone been able to build this in shader graph? i tried but i must be misunderstanding something as soon as i set the position it just vanishes :(
     
  8. TheSwanCollective

    TheSwanCollective

    Joined:
    May 6, 2016
    Posts:
    25
    Did you ever come around to release your wonderful shader to the public? Thanks in advance Renan!
     
unityunity