Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

afs Advanced Foliage Package [released]

Discussion in 'Assets and Asset Store' started by larsbertram1, May 23, 2012.

  1. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    196
    ok - thanks - I had bought both packages earlier but I did not know which one to use. Sorry to post in wrong thread.
     
  2. Montreseur

    Montreseur

    Joined:
    Jan 24, 2014
    Posts:
    49
    Are their any youtube videos for setting this up that anyone knows of?
     
  3. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    Hi there. The geometry painting tool will paint trees on top of other trees. Is there any way to avoid this?
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    hi there,
    you may check "Prevent Overlap" to avoid that objects are added on top of already added objects.

    lars
     
  5. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    Hi lars,

    Thanks for the reply. This does not seem to be the case for me. I have that checked. My trees, which have a mesh collider on them (a separate mesh of the tree with far less poly's) is also there. I do not know if this makes a difference or not though. I have to be missing something overly obvious here.
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    hmm, for me it works – at least when using primitive colliders like spheres, capsules and boxes.

    lars
     
  7. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    I guess I will be hand placing my trees then haha. I imagine no issues will happen with the grass and small plants with no collision of any sorts at least. :)
     
  8. kaarme

    kaarme

    Joined:
    May 1, 2014
    Posts:
    177
    Please reload web demo. It says I need to install Unity Web plugin, but other games work.
     
  9. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    ^---- This.

    Demo is foofed.
     
  10. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Update the demo webplayer?

    Or is this project dead?
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    it is not dead – but i focus on the advanced foliage shader package.
    lars
     
  12. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
  14. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hmm. I was pretty sure I had already bought that. Seemingly not. I know for sure I tested it.
    Appreciate the point in the right direction. Will reassess my needs then.
     
  15. kaarme

    kaarme

    Joined:
    May 1, 2014
    Posts:
    177
    UnityException: Texture 'normal_specular' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the Texture Import Settings.
    AfsFoliageToolEditor.mergeTextureFoliage () (at Assets/Advanced Foliage Shader v4/Scripts/Foliage Tool AFS v4/Editor/AfsFoliageToolEditor.cs:826)

    And the tree is invisible... I was trying to convert a tree. Also I needed to convert some scripts.

    EDIT: I think I know what was wrong... But every time when an import is incorrect the original tree will turn black.
     
    Last edited: Sep 6, 2015
  16. kaarme

    kaarme

    Joined:
    May 1, 2014
    Posts:
    177
    Okay... What am I supposed to do with this invisible material?
    EDIT: Okay. Sometimes converting makes unity crash and the tree is always invisible. I am getting annoyed.
     
    Last edited: Sep 6, 2015
  17. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  18. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Are there any known things to do wrong? I tried several grass and shader packages, but my terrain grass always looks glued on or like a carpet. This screenshot is with RTP3 and AFS4.
     

    Attached Files:

  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    let me say it this way: there are some things you could improve.
    • first of all: albedo and healthy and dry color of the grass: try to make it match the terrain grass texture.
      --> switch to deferred shading, then choose "albedo" in the scene view tab and look how they fit.
    • next have a look at the alpha channel of your grass texture: all blades extend right to the bottom of the texture. thus you get a pretty harsh line were the grass geometry intersects with the terrain.
      --> lower the density in the alpha channel at lower regions: some blades might even not "hit" the ground.
    i just made a quick sketch of how it might look in case you edited the alpha channel:
    grass-border.png
     
  20. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Okay, that was great, thank you. So obvious and so easy... I chose better matching textures and tried to match color and saturation (and added ambient occlusion) and everything looks 1000x better.
     

    Attached Files:

    EyeOnYou likes this.
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    wow, that looks pretty nice!
     
  22. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    Is that package still maintained and working with Unity 5.5 out of the box?
    The last update was in 2013...
     
  23. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    @larsbertram1 I just purchased your package, and I get a dozen compiler errors with Unity 5:
    Can you fix them?

    For example (but there are more):

    Shader error in 'AFS_v2/Advanced Foliage Shader Atlas': variable 'c' used without having been completely initialized at Assets/Advanced Foliage Package v2/Advanced Foliage Shader v2.02/Shaders/Includes/Tree.cginc(52) (on d3d11)

    Compiling Fragment program with DIRECTIONAL
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
  25. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    @larsbertram Please suggest a way to fix the compiler errors. Or do you say that with your new foliage shader it will work?

    I have spent money on the asset, and currently I can't use it.
    You still offer it, so I guess you need to find a way to make it running again.
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    yes, it should work with the new foliage shaders – although it does not ship with pbs textures of course.
    you have been warned before purchasing the package that it was written for unity 3.x.
    but i may look into it.
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    to fix shader errors:
    find:
    "fixed4 c;"
    in cg includes files (like "Tree.cginc") and change it to:
    "fixed4 c = 1;"
    fixing the mesh combine script is a bit more cumbersome though...
    i will push a fix – but you will get much better results using the advanced foliage shaders v4 anyway.
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    update uploaded.
     
    twobob likes this.
  29. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    Thank you.
    I want to try your Foliage Shader v4 with the Foliage Pack, but somebody wrote in the product reviews that it wouldn't work out of the box. Or has that been resolved already?
    Can you make it so that the Foliage Package works with the foliage shader v4 out of the box?
    I mean before I purchase it? I guess it would help other people, too.

    And another question, please: Does your Foliage Shader work with Unity 5.5 already?
     
    Last edited: Oct 17, 2016
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    well, i do not know why it should not work.

    nope. upcoming version 5 should do.
     
    twobob likes this.
  31. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    @larsbertram Can you not release the demo scene for the foliage package that you have shown on YouTube? It looks so good, I would really like to learn from it.
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    i do not have it anymore. it is more than 3 years old.
     
  33. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    :( What a pity! Can't you re-do it? I would really like to learn from it.
     
  34. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    When can we expect an update to foliage shader 5 for Unity 5.5?
     
    HermieW likes this.
  35. EyeOnYou

    EyeOnYou

    Joined:
    Jun 11, 2015
    Posts:
    21
    @larsbertram1 The "Translucency Color" in the afs_v2 shader atlas doesn't have any effect, right? I can chose whatever color I want to, and it doesn't change anything.
    I thought that I could actually look through the foliage if I chose the right values, but I can't.
     
  36. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    On the off chance anyone still uses this ancient version. and also uses the included geometry brush.
    It will break on placing items with LOD.
    You can simply fix this by adjusting GBUtils at around line 84 to read
    Code (csharp):
    1.  
    2. // This may fail for LOD cases
    3. Renderer test = gbSettingsScript.activeGeometry [randomID].transform.GetComponent<Renderer> ();
    4. //check
    5.                 if (test == null) {
    6. // Yup, fail, let's go get one                
    7.                     test = gbSettingsScript.activeGeometry [randomID].transform.GetComponentInChildren<Renderer> ();
    8.         }
    9. // Okay so NOW work out the bounds        
    10.       Bounds bounds = test.bounds;
    11.