Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

HDRP vertex wind

Discussion in 'Graphics Experimental Previews' started by YuriyPopov, Feb 10, 2019.

  1. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    Hi there,
    Can someone explain to me how to use the vertex wind feature of hdrp for stuff like flags and banners. As far as I know you need to paint vertex colors in your 3d software of choise but what colors and so on is unclear.
    I have read the thread about the trees that seem to use this feature. Is it the same deal ?
     
    AntonioModer likes this.
  2. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    Any solution yet? Can Unity support HDRP vertex shader with wind zone?
     
    AntonioModer and KingKadriK like this.
  3. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    Would be nice to have a node for Unity Wind Zone in the Shader Graph.
     
    AntonioModer likes this.
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  5. GilG

    GilG

    Joined:
    Jan 30, 2017
    Posts:
    27
    I second this.
    I don't know if the solution changed but I didn't found a way to use the Wind Zone values inside the Shader Graph.

    If there is a way please let me know.
    If not, it could be added :)
     
  6. Black_Raptor

    Black_Raptor

    Joined:
    Nov 3, 2014
    Posts:
    181
    You can write a script who copy the wind zone value and use them in your shader. So if you have windstrenght and wind intensity input in your shader your script can change them with the value of your wind zone :)
     
    FernandoMK and GilG like this.
  7. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    In case useful to this thread (or for feedback if anyone has a better solution!) I wrote up my attempt of HDRP Shader Graphs and Wind Zones in a blog: https://extra-ordinary.tv/2022/08/20/hdrp-shader-graph-and-wind-zones/ - it includes the C# to copy the wind zone values and use them in a shader, plus how I put a shader together. (I am new to shaders, so there may be better approaches!)
     

    Attached Files:

    AntonioModer likes this.
  8. AntonioModer

    AntonioModer

    Joined:
    Jul 29, 2014
    Posts:
    65
    Thanks )
    My HDRP ShaderGraph file: https://drive.google.com/file/d/1ntHdzzf-bMNmeBea2k_hbBoTd_6ghwO1/view?usp=sharing
     
    thephox1982 and akent99 like this.
  9. AntonioModer

    AntonioModer

    Joined:
    Jul 29, 2014
    Posts:
    65
    Now I'm thinking how to make a local wind. How do you think it can be done ?
     
  10. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    For wind you have many options including vertex color based
    others include wind driven by a mask or noise texture

    I prefer vertex color as you don't need to worry about the model's size and reduce how any materials that could be needed with a noise or texture-based system

    for painting vertex color i made a tool that is included in my asset DE Environment
    this tool will bake all the vertex color directly into the model within unity
    Main Bending Strength = Vertex Color Red (R)
    Random Strength = Vertex Color Green (G)
    Tumbling Strength = Vertex Color Blue (B)

    On each sub mesh users may additionally re bake or reset selected sub mesh individually if needed with B (Bake) or R (Reset) selections

    the bake will detect all LOD children and bake each one with one click
    easy to modify or tweak settings to best fit your style

    upload_2022-9-30_23-57-14.png


    upload_2022-9-30_23-57-47.png
     
    Last edited: Oct 1, 2022
    AntonioModer likes this.
  11. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    The version I did sets global defaults that shaders can pick up. What sort of "local" do you want? E.g. if distance from the camera, I assume all the LOD support can be used (I am a newbie - I have never used LOD in anger). If you want trees in particular areas to have different strengths (without changing the properties of trees individually), I would be tempted just to create variants of a tree and adjust the settings by hand (!). But otherwise you can probably use the world position of an object somehow to adjust its strength. (But no, I have never tried this.)
     
  12. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    about setting up wind "local"
    as a wind shader does all the calculations from the value provided by wind zone all you need is a switch to "local" that provides a local input to replace them aka float or vector

    this is handy for platforms that use limited SDK such as VRChat, by setting local you no longer need a controller or wind zone in the project and just preset how you wish in the shader settings

    upload_2022-10-1_10-30-32.png

    upload_2022-10-1_10-31-0.png
     
  13. AntonioModer

    AntonioModer

    Joined:
    Jul 29, 2014
    Posts:
    65
    Yes, the first thought is to make different materials, with different wind strengths and assign them to the trees. I mean local areas like in the standard wind (Spherical mode) which only affects the SpeedTree
     
    Last edited: Oct 1, 2022