Search Unity

Speedtree in HDRP?

Discussion in 'High Definition Render Pipeline' started by Win3xploder, Feb 26, 2020.

  1. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    160
    Now that HDRP is out of preview, wouldn't it be reasonable to expect Speedtree to work with it, at last? :)
     
    blueffury and zeropointblack like this.
  2. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    I second that - Unity please provide and update what is going on with speed tree v8 and latest HDRP.
     
    zeropointblack and Win3xploder like this.
  3. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    160
    I contacted SpeedTree and they told me that they gave all the assets necessary for the implementation to Unity. The ball is in your court!
     
  4. FiveXGames

    FiveXGames

    Joined:
    Apr 27, 2016
    Posts:
    43
    Any news?
     
  5. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    289
    I cannot understand why it is delayed this much. @SebLagarde
     
  6. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Because its not a core feature?

    Also, I don't understand why Unity should do it?
    Its a SpeedTree product, and their license. Their interest and profit.

    Rewriting manually everything would be a pain, since the lack of the shader documentation atm is immense.
    I bet this is stopping everyone from the SpeedTree porting shaders.

    They're kinda lazy a*oles, and I understand why.


    I've been porting HDRP v6 SpeedTree via ASE on my own. Need to fix some wind issues, other than that it works.
    If you've got ASE I can share the shader later once I've fixed all the issues and tested it (probably after this weekend, unless something horrible brokes).

    (ASE needed because I'm using customly passed wind time. Other than that I should work w/o it, if you don't need wind)
     
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,253
    I asked on the SpeedTree forum yesterday, since HDRP is now out of preview. That's the answer, fyi:

    https://forum.speedtree.com/forum/s...edtree-modeler/8204-speedtree-unity-with-hdrp
     
    xVergilx likes this.
  8. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    "Bring a usable SpeedTree solution to the shader graph"?
    Really?

    WTF

    They should've ported that shader ages ago without any shader graph.
    And this answer is completely rage enducing.
     
  9. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Speedtree integration is one of the most dissapointing storys within Unity.
    It was never really finished in my opinion.

    What we need is a completely re-written solution, based on Speedtree or not....
     
    Last edited: Mar 4, 2020
    hippocoder likes this.
  10. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    160
    The worst part is that there is no statement from Unity on the matter whatsoever.
     
    Velo222 and hippocoder like this.
  11. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,253
    Indeed, it seems like Unity thinks it's SpeedTree's problem and SpeedTree thinks it's Unity's problem.
     
  12. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Team Work Makes the Dream work right guys?

    Come on guys speed tree and unity we need vegetation options in HDRP please give us some sort of news. Like "hey leave us alone" well get to it in our own unity fashion - Now speed tree's turn. Don't look at us we provide a ready to use editor it's unity's fault they haven't figured something out with THEIR shaders. All Joking aside it's not like people's companies/projects and livelihood's are relying on this oh wait some of us are dang:( Let's go guys!
     
    hippocoder likes this.
  13. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    This might be useful for some of you guys as a base shader:
    https://forum.unity.com/threads/an-almost-complete-speedtree-v6-hdrp-port-via-ase.840517/

    Its a nowhere complete, but at least you'd be able to render the v6 trees in the viewport / game (hopefully :p)

    I was unable to find whats the difference with the Global Wind code in built-in vs HDRP, so I've decided to just publish as is with the Global Wind node disconnected.

    Probably gonna spend a little bit of time on the wind and also ask guys from the ASE discord.
    Maybe they'll be able to figure that stuff out. (or not :p )
     
    borgstation, Velo222, sqallpl and 2 others like this.
  14. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I still can't believe there's no good tree or cloud solutions for HDRP. Either built-in (i.e. comes default with Unity) or on the asset store right now. I am using NatureManufacture's tree's in HDRP. They are decent, and quite frankly the only 3rd party asset I've found to be worth anything -- and even they lack a lot of good features.

    I don't even know if there's any others out there publicly besides people making their own. It pretty frustrating if you're working with HDRP and don't have the ability to upgrade shaders yourself.
     
    PutridEx and xVergilx like this.
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,253
    Almost all of the NatureManufacture assets are HDRP and they are awesome. Tropical Forest Pack is also quite good (currently beta). And Enviro HDRP clouds are awesome. I did a test this week:



    And I won't hold my breath any longer for SpeedTree to come up with anything, they clearly abandoned their lots of money paying customers. I mean, the small publishers can keep up while SpeedTree who cost a lost more don't seem to care at all.
     
    Lex4art and xVergilx like this.
  16. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Good news guys! I've managed to fix issues regarding wind, and now the v6 port is complete! :)
    It also supports custom time manipulation (example script now included), which should be pretty useful for some games.

    (well, any that doesn't rely on TimeScale for pausing and uses trees + wind)

    (link is in my signature)
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I find that going easy on certain vegetables and fibre can also fix issue with wind.

    But joking aside thanks for helping out. A lot of people don't have your technical skill so it'll be helpful :)
     
    ROBYER1, Velo222 and xVergilx like this.
  18. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Very cool! Maybe a silly a question, but I'm assuming one would need to use v6 Speedtrees only then? No version 7 or anything else will work correct?
     
  19. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    If the data layout is the same, they could work. (in theory)

    But probably will look differently.
    SpeedTree shaders seems to be backward compatible.

    Worth trying?
     
  20. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Ok. I will probably give it a try at some point then :) Definitely worth trying. Even if it doesn't work, I can get some v6 SpeedTrees (at least I think if they still sell them).
     
    xVergilx likes this.
  21. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    160
    Really hope that a developer sees this as this feature is vital to making natural environments in Unity!
     
    Last edited: Mar 10, 2020
  22. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,742
    Ive had SpeedTrees working for a while now, not hard to do at all. Heres what i do:

    Once mats are converted, you must add Alpha Cutoff (0.01) in the mats for any fronds and leaves, then adjust the metallic on your base color/texture (0.7), and make sure to lower smoothness to 0, if not your LODS will look crapy.

    Then i add my wind/foliage shader, and all set.
     
  23. unity_9rBp5m5c2_ph5g

    unity_9rBp5m5c2_ph5g

    Joined:
    Apr 28, 2020
    Posts:
    12
    This sounds awesome, maybe you can help me with a quick question. I can't get wind to work at all with speedtree 6 and unity, hdrp or not. I'm not sure what I'm doing wrong, and I can't seem to find a solution anywheres. The speedtree sample trees from the unity store work perfectly fine.
     
  24. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Check out ShaderTimeControlExample script. It feeds values for the current time to the shader.

    Basically placing one in the scene should be enough. This is in case if you're referring to my port.

    Otherwise - no idea :)
    Need more information. Basically placing trees on the terrain + wind zone should work for the default v6 trees.
     
  25. unity_9rBp5m5c2_ph5g

    unity_9rBp5m5c2_ph5g

    Joined:
    Apr 28, 2020
    Posts:
    12
    Hi, I actually just solved my problem, lol

    It turns out it was the location of the windzone. The speedtree samples worked fine outside the windzone, but the speedtree 6 trees need to be placed within the windzone. Since the sample trees were working, I wasn't even considering the windzone location to be a problem.

    Thank you for the helping, it was greatly appreciated. :)
     
    xVergilx likes this.
  26. Zicore

    Zicore

    Joined:
    Jul 2, 2018
    Posts:
    10
    Dang it, I just bought a month of Speed Tree 8 just to find out that wind isn't supported.
     
  27. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    They announced SpeedTree v9 and v8 is still not supported for HDRP. This is getting ridiculous. HDRP has been at a point where SpeedTree can convert their shaders for a while now. HDRP not being ready enough is bullshit. That was a valid excuse the first year but we're past that. I've spent nearly 1000 USD on speedtrees. At this point I cannot recommend SpeedTree to anyone. Go with NatureManufacture. Far better support and price/quality ratio.
     
    Migueljb and xVergilx like this.
  28. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Be great to get some kind of official update from unity or speed tree on whats going on with HDRP and speed tree were all waiting...
     
    Velo222 likes this.
  29. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Yes, I asked them about a year and half ago about Speedtree in HDRP and they said they would.....

    There's not really any information or communication happening. Is Unity wanting Speedtrees in HDRP? Is Speedtree going to implement Speedtrees for HDRP?
     
  30. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,253
    No, they say Unity has to do it. Unity doesn't. I bought 1.000+ € SpeedTree from them. Waste of money etc. Never again!
     
  31. jezelf

    jezelf

    Joined:
    Nov 17, 2015
    Posts:
    3
    I've got ST8 working in the HDRP templates , maybe this will help others while waiting for the offical Unity/SpeedTree info to come through...

    I followed the Speed Tree process here, which I'm sure you know about, but it's a bit out of date but works.

    For Unity use template 2 rooms ,because the first one had incorrect PBR lighting - which I worked out, but nice to know I wasn't imagining it. This might be tripping people up.

    My main issue was getting subsurface maps to match Speed Tree view port for my White Oak. So I had to do some texture edits in ST, and create a custom Diffusion Profile in Unity to compliment.

    In my experience, the default Subsurface Scattering/Thickness/Translucency (would be nice to conform to one) settings exported from Speed Tree is not a match to Unity's needs.

    In that, in ST I unchecked Subsurface colour and only use the Subsurface % and edited the brightness and contrast had to be clamped to black and white for wood branch vs leaves , (Black=opaque, white=transparent) to get the amount of subsurface seen in Speed Tree view port in Unity. This may take some back and forth between the two, be sure to have the same lighting conditions and sun position in both.

    Important note is that if your branch area is not 100% black ( - in ST that is. It gets inverted to white on export to Unity) it gets affected by Unity's Diffusion profile easily, tinting it the leaf subsurface colour. The threshold can be very fine there.Took me a while to figure out what was happening.

    So I also needed to edit the foliage Diffusion Profile for my tree species in Unity to mimic the subsurface colour seen in ST and prevent the branch areas from tinting the same colour. I duplicated the Bamboo one from the above rooms template, and modified it.

    This can take some trial and error but these are the bits to play with...

    Scattering Distance: This will control the subsurface/transparency colour seen in the viewport and how much your branches are affected (to match the colour seen in ST for a White Oak, I have R=30, G=50, B=0, intensity=0 atm)

    Thickness Remap:
    Set for 3 - of course, this may differ depending on the tree species - I have only done this one so far, but expect to have diffusion profiles for various species - the default 'foliage' doesn't cut it for me..

    I now have close to WYSIWYG from Speed Tree viewport in Unity, but I'm tweaking it all the time, especially expect to do it more for an actual scene than a R&D template.

    I'm working on a more open world game - with the new template, though has foliage in it, is all setup for a controlled, confined environment with reflection probes and I need assured template settings for an open world terrain. So I have a tree prefab in the open air room and I created a terrain with grass materials and painted a few trees on that.

    It's on the terrain I'm mostly testing, and going to the room scene after to see if it's still looking ok - which it is a lot brighter because of the reflection probes so I expect more tweaks with lighting will be in order.

    Unity v2020.2.1f1
    ST v8.4.2 (Unity Subscription Edition)
     
    Last edited: Jan 15, 2021
  32. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Good info jezelf. Is there dedicated Speed Tree Shaders currently that work in HDRP? The main thing is the wind. Does the ST wind transfer over to whatever hdrp shaders are for it. Without that wind transfering over correctly it doesn't matter how good they look need the life into the trees only the wind provides.
     
    Velo222 likes this.
  33. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Nope, as far as I know. That's why I made custom ASE based shader. (But its for v6 trees)
    Has a few issues though, and not a complete 1 to 1 conversion, but, may be useful for transfering wind functions if you have ASE.

    Main issue - it doesn't seems to batch with SRP batcher correctly, and I don't know why. Asking ASE devs, and Unity forum yielded zero results, so yeah hit a brick wall.

    Alternatively, there's always a source for the SpeedTree shader (available in builtin shaders) which allows to port shaders with anything, including ShaderGraph as long as you've got time and basic shader knowledge.


    But the real problem here is Speed Tree devs. They just don't want to port shaders at all.
    Which is both upsetting and infuriating at the same time.
     
  34. jezelf

    jezelf

    Joined:
    Nov 17, 2015
    Posts:
    3
    I'm using the Lit shader. And not got to wind yet. But I will need it too, you're right it adds the life - my focus was WYSIWYG for SpeedTree side atm. Wind will be the next step, but sounds like there's a wall to get through first.
     
  35. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    579

    SHAME ON YOU! What irrational expectation...
     
  36. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    579
    Rest assured Epic has something to do with it. Don't be surprised if you see them buying Speedtree in the future.
     
  37. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    Rowlan likes this.
  38. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Before getting your hopes up, I just want to point that commit is still in WIP branch - meaning it's not merged yet.

    Unity has had Speedtree 8 HDRP shaders in wip branches for a long time (year+), one can just hope this time around they actually merge them to main branches :)
     
  39. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Ya the main thing is the wind. I think most people don't have too much trouble getting speedtrees into Unity HDRP, for the most part. It's just that the wind doesn't work. Having to download files from a 3rd party site like Github, for Unity, just seems weird.

    Here's to hoping what sqallpl posted above actually works -- the speed tree 8 shader graphs for HDRP, if they work with wind, would be excellent.
     
  40. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    Rowlan and xVergilx like this.
  41. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    While it is nice to have a specific SpeedTree shader that supports wind, most of the people neglect the fact it may tank your performance. That is if nothing will be done to how SRP batcher works.

    SpeedTree is based on submeshes, which will break batching by default. And even if that is supported in the future - there's an issue with light probes.

    Submitted my opinion, but top priority for this feature should be SRP batcher and features that are missing.
     
    sqallpl likes this.
  42. sammtan

    sammtan

    Joined:
    Jul 2, 2019
    Posts:
    14
    Yeah can u shader that shader? looks like it would be very helpful
     
  43. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296