Search Unity

Best terrain & vegetation asset/shader

Discussion in 'General Graphics' started by Liminal-Ridges, Feb 28, 2018.

  1. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    To those who have used these types of assets,what is the best way to make my terrain look as realistic as possible? Including trees and grass although those are going to need different shaders.
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    I am currently writing a decent foliage shader for the trees and grass, when finished (couple weeks) ill post a link here to the github :) you and everyone is free to use it when posted

    will post pics soon.
     
  3. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Waiting for pics man, most 'realistic' foliage shaders in asset store are just scams, only one or two actually look real.
     
  4. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    Thats not true, if used properly many of the store shaders are more than realistic, with some offering some very advanced SSS solutions . If you believe that the asset store ones are "scams", mine will be in no way superior. Make no mistake, a lot of the asset store shaders have taken years to make and are extremely advanced.



    Are you sure you are setting up your lighting and graphical settings properly for your projects? You would be surprised how different the results the same shader will produce with different lighting setups etc

    It also matters about the quality of the shader inputs. If you are using low res or garbage textures, it will produce similar results. The same can be said for all the shader inputs, often very specific settings are required and those can only be ascertained from the asset documentation/author/support.

    Head over to mega scans and get some decent PBR textures that were made for a foliage shader of advanced quality (you need extra mappings like thickness etc, and those maps need to be high quality or the effect will be of lower quality), and then slot those into the shaders, set up your lighting properly and you will have very realistic looking foliage for almost no effort. Anything more will require you to learn to write shaders because unfortunately, a generic solution will never be as good as a custom one tailored specifically for your game/project/use case.
     
  5. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    I used most of the packages unmodified and still could see how flat the textures looked. It was just not the "realistic" they sell. Then again maybe i have to setup it manually.

    Post-stack ambient did some difference creating something around the leaves but still.

    What do you have to tell me about lighting? Im gonna try megascans and see if there is deference.
     
  6. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983

    Have you not tried this:

    https://assetstore.unity.com/packages/vfx/shaders/subsurface-scattering-shader-3254

    Thats just one example of a SSS shader. its cheap, and if you put decent textures in you can get a variety of quality results, ranging from terrible to downright realistic.

    You need to add the correct inputs, if your textures looked "flat" you obviously have not provided the correct maps such as thickness etc.

    For a decent foliage shader you will need following effects and possible maps for those effects at minimum:

    Sub surface scattering : thickness map - almost most important
    Wind vertex displacement : displacement map
    PBR basics - metallic, roughness, albedo, normal
    Global illumination - if possible using global illumination will work well
    Realtime shadows

    The quality and resolution of the inputs will determine what quality and therefore realism you get in the final result.

    Megascans will set you up with some decent quality maps, but getting a good SSS effect is a must for the foliage to feel like foliage

    EDIT: for lighting look at lighting box on the asset store to set up almost perfect lights automagically
     
  7. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Thanks alot man, i thought SS shader was for objects like candles maybe lambs etc. I had no clue it can be used for vegetation.

    About lighting box i see many negative reviews but unity's lighting system is S*** and nevertheless seems something new and says it contains some foliage shaders itself so im gonna try that too. I see many scenes though with ground full of grass but supposedly no low fps, is there some special technique?

    I think megascans is more than decent, the highest quality atm actually. About all these you wrote (displacement, thickness etc) i havent met any of these names in shader slots, is there any source i can get more info?
     
    Last edited: Mar 8, 2018
    MadeFromPolygons likes this.
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    No problem!

    Unfortunately there are not any resources I know of that explain all the maps.

    However you can learn about some of the maps from the substance documentation:

    https://support.allegorithmic.com/documentation/display/SPDOC/Baker+List

    As for displacement map, its used to move vertex about (like wind movement or water movement etc)

    If you get a good SSS effect (which requires a thickness map to determine where to scatter light at what amounts) combined with standard shader (albedo, normal, roughness and metallic) and megascans foliage textures, you will have an amazing foliage look ;)


    EDIT: https://assetstore.unity.com/packag...ghting-box-2-next-gen-lighting-solution-93057
     
  9. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Hey man, i got 2 more questions for you.

    I contacted the SSS author and told me that it is not designed for vegetation. What do you have in mind?

    And what is tesselation shaders?
     
  10. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
    The most important part of the the foliage and trees is the Texture quality. Some textures looks very realistic and some others looks very bad
    Here you can see unity's lighting demo grass texture :
    photo_2018-03-11_11-31-19.jpg

    Foliage only needs Ambient occlusion effect from post effects to looks beautiful (fake shadows)




    Another beautiful texture :

    Bad reviews are for Import errors
     
  11. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875





    AO Effect:


    This is Unity:




    More Images:




     
    Last edited: Mar 11, 2018
  12. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Thank you man, those three of your samples is the closest to the quality im looking for:





    Is it only about the textures/lights/ambient or something more? Also how did they do the foggy effect on the first image?
     
  13. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
    Download Lighting Box 2 and watch the video play list (specially 2.7 video playlist) :
    Play List VIdeos LB2.7
    Tree Creator Tutorials
     
  14. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Can we get close to the Book of the Dead graphics? In that video i saw the grass moving realistically (only the top part) instead for moving the whole texture. Maybe they were 3d?
     
  15. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    you would want SSS then for that, try any SSS itll be better than no SSS
     
  16. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
    All grass solutions are 3d
    You must create custom shaders for better grass rendering and wind support
    There are a lot of the wind shader algorithms in the net
    photo_2018-03-12_02-37-30.jpg
     
  17. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
    You can find grass model from Nature sample scene:
    Lighting Box Grass Shader + Wind:
    ScreenShotScreenShot10.jpg

    ScreenShotScreenShot10.jpg ScreenShotScreenShot11.jpg ScreenShotScreenShot13.jpg ScreenShotScreenShot14.jpg ScreenShotScreenShot15.jpg
     
  18. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
  19. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    How is SSS used on foliage? On the bark or the leaves/grass?

    By 3d i mean mesh not textures. How can i make meshes move with the wind?
     
  20. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
    You can use Wind effect in shader code (vertex shader)
    3D grass is an plane with grass texture
     
  21. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    just bake thickness map for the model and slot it into the thickness slot on the SSS shader, same way SSS is used on anything
     
  22. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    In the Book of the Dead you can see the grass moving in real 3d not plane. It looks like its a mesh and only thje top part is moved by the wind.

    Imma try and post an image
     
    MadeFromPolygons likes this.
  23. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    Yes thats a vertex shader. I feel you are either overthinking this or not understanding the advice we are giving.

    Try a vertex displacement effect coupled with some standard PBR coupled with SSS and decent lighting as a starting point, and only AFTER that come back and say what about XYZ. Right now your assuming issues might come up or it wont look like X but you dont even know what results your going to get.

    EDIT: plane or mesh it doesnt matter its still a displacement effect

    Great, look forward to it :) will offer advice on where to go next once you have!
     
  24. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
  25. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
    It's not only 1 plane with 2 triangles. An 3D grass is a collection of the mi-poly planes

    To have very realistic wind mode you can use speed tree
     
  26. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Where do i get their wind system? Is it included in some pack of theirs?
     
  27. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
    Tools->Wind Wizard

    Also you can change the wind from SpeedTree shader inside unity
     
  28. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Hey guys, i found exactly what i was looking for to show you. Its what i have in mind (graphics quality):

    https://drive.google.com/file/d/1lLN4lPfYFkp0cX4krOcw0RHD5f237lJy/view

    It uses layered materials (photogrammetry + classic texturing) through the HDRP in Unity 2018.1 to bring this quality playable to the mainstream computer. In their project they use a new shader (LayeredLit) that does the layering combined with all other elements (post-process, lighting etc).

    I just don't know yet what other maps the materials have (normal, height, ao, displacement?) etc. I'm gonna examine a bit now.
     
  29. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    It seems that LayerLit is used for props like rocks and just Lit for foliage. I have no further idea what happens in there, i havent used such a complex shader again.


     
  30. holyfot

    holyfot

    Joined:
    Dec 16, 2016
    Posts:
    42
  31. briank

    briank

    Joined:
    Mar 25, 2017
    Posts:
    74
  32. Game-Armada

    Game-Armada

    Joined:
    Apr 29, 2013
    Posts:
    66