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 Wind and Tree Tools

Discussion in 'Graphics Experimental Previews' started by rz_0lento, Jun 13, 2018.

  1. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Is there any doc or tool for HDRP wind system available yet? Mostly interested on what kind of preparations will those tree assets need to work with this system.

    I saw this tweet: https://twitter.com/robertcupisz/status/1003056451726737408 and it mentioned they used custom tool to define tree rig. I also noticed that there are some assets on the assetstore that backported the windsystem to legacy and lw here: https://assetstore.unity.com/packages/3d/vegetation/trees/mountain-trees-dynamic-nature-107004 but there's no info on how they did it, or how to apply this for your own custom trees.

    Basically what happens if you just enable wind on regular mesh on HD Lit shader is that whole mesh gets warped, so it's clearly missing some baked data. So, again, main questions are: is that tree rig tool going to be available and if not using that tool, what preparations meshes need (so they can be used with wind properties on lit shader)?
     
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
  3. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I actually looked at that specific demo before posting but while the tree fbx suggest vertex colors (it's named TreeVxColorSetup.fbx after all), all the vertex colors in the FBX file are only solid black. I also checked the WinTest.unity map and scene trees appear solid black as well when assigning vertex color shader to them. Simply painting a custom mesh vertices to black will not change anything (tested it).

    I haven't checked the actual vertex color data yet so there could be some values there that just aren't visible just by eyeballing the mesh/materials.
     
  4. Paddington_Bear

    Paddington_Bear

    Joined:
    Dec 9, 2012
    Posts:
    274
    Huh, I had sort of assumed they were pushing a new wind solution perhaps with the terrain system overhaul? In any case theres a decent chance they're waiting for SpeedTree8 to get a unity release (which by all accounts, is on the near horizon) before the finalise their wind solution (if they have one).

    I understand that the BoTD demo had very specific wind requirements (as dictated by the actual composition and story) but Christ, their old wind system is seriously lacking. I assumed that was part of the 2018 cycle, even if they hadn't mentioned it..

    As far as tree rigs go thats bound to be under the ST8 domain, will have to wait and see what they do.

    Fingers crossed.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It could just be looking at the vertical and horizontal vectors between verts and then applying additionalVertexStreams on the Unity side. At least, that's how I would approach it.

    It is wise for them to remain using vert colours for wind so it's compatible with a wide range of media and tools.

    If the new tool is compulsory then it is a bad decision.
     
  6. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    I was able to vertex color some trees in Maya, although it wasn't easy to read them once they were painted because it was done in alpha rather than in color. absolute clear was the most affected by wind and a mid grey was static. From the blog post they were done in 3ds max so they may be done differently or export different, hard to make sense of it.
     
    rz_0lento likes this.
  7. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You are right, it's the alpha color indeed. I made a custom shader to preview this as well. I painted some alphas into speedtree model with polybrush and it works like you explained but this would really need some proper tool (I hope unity releases theirs).

    What's weird is that they did the coloring this way, it would be more intuitive to make the full alpha to indicate rigid parts as that's what models default to. Now when it's the opposite, if you just enable wind on models that hasn't been properly prepared, they warp in weird looking manner. If it were the other way around, you could just paint the parts with lower alpha value which you want to influence with the wind and leave the rest of the model as is.

    PS. I didn't even realize that vertex colors had alpha as well, this is why I didn't even look for it :D
     
  8. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  9. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I really hope they make ST8 trees work with HDRP shaders wind system automatically, it would make a lot of sense to not have to rely on special speedtree shaders anymore.
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Have to disagree because:
    • Thousands of existing models use alpha = 1 for maximum "influence" from wind
    • It's not 0 for max influence because the maths would need to be inverted (it's wind multi)
    • Anyone who actually knows maya knows how to show vert alpha as white... same for any 3D package
    • You save a couple of instructions. It's not a lot, but if you are vertex bound then it probably helps a little with grass or on mobiles.
    (For Maya: Preferences>Display/Polygons> Display alpha color set as greyscale)
     
    rz_0lento likes this.
  11. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    They do? What models use this convention? (I'm genuinely curious as I didn't know there were any specific approaches that got popular)

    This actually makes more sense as it would indeed be extra work (and you need to prepare the models anyway).

    Main reason why this feels counter intuitive is because enabling wind on models that haven't been prepared yet breaks them immediately. I'd prefer if such mistakes would somehow slip through, it wouldn't do anything bad (but I guess now it's more obvious you forgot).
     
  12. janloehr

    janloehr

    Joined:
    Jun 30, 2017
    Posts:
    8
    So that worked, until today. Updated to 3.0.0 via Package Manager. Someone knows what changed here? Can't spot a difference in the hdrp git :/

    Edit: Nevermind.. Maybe someone stumbles as well. Took me 1 Day to realize, it only works rendered through the camera now. Not in Scene View anymore :(
     
    Last edited: Jul 19, 2018
  13. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    It's probably a perf optimization, for example I couldn't even have book of the dead environment open simultaneously with both scene and game view open as it made the whole editor crawl, would be curious if changes like these would help there.
     
  14. NoSpoonAnim

    NoSpoonAnim

    Joined:
    Feb 10, 2016
    Posts:
    13
    can somebody explain please, how come that vertex data seems inverted in new unity 2018.3.0.f2?
    i used botd trees and the trunk and stump wave like crazy, but the branches are not moving at all, except for the pivot bending :D

    i painted the alpha vert channel directly in unity and it works correctly. is there an easy way (script perhaps?) to invert objects vert data values?
     
    Last edited: Dec 17, 2018
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Speedtree 8 format trees had optimisations done to the vertex shader, so this may factor in for 2018.3 - please post a bug report so staff can check for you.
     
  16. BrettNexefy

    BrettNexefy

    Joined:
    May 24, 2018
    Posts:
    13
    You should be enable it in the viewport by going here:


    (Animated Materials were not enabled by default when I started a new 2018.3 Project)