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

Advanced foliage shader [released]

Discussion in 'Assets and Asset Store' started by larsbertram1, Apr 24, 2012.

  1. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,302
    It says in the manual that this is supposed to work with global fog. In 5.2 the fog stops where the billboards begin.
    That's with both forward and deferred rendering.

    They may have changed the way global fog works. Did you always have to specify half the properties in the lighting settings, and the other half on the script on camera to get global fog to work?
     
    Last edited: Nov 1, 2015
  2. cej

    cej

    Joined:
    Sep 10, 2015
    Posts:
    2
    I am trying to use AFS on a game with a lowpoly/hard-normals look. Unforunetly this seems to cause some issues with the edge flutter specifically. The verticies I've applied edgeflutter to split along the edges. Did anyone find a solution for this?
     
  3. kaarme

    kaarme

    Joined:
    May 1, 2014
    Posts:
    177
    I loaded the Wind Demoscene and I see absolutely no difference in bending between the two plants. Nothing seems to change this. This has to be a bug, so please fix it.
     
  4. Misciagno

    Misciagno

    Joined:
    Jul 27, 2013
    Posts:
    88
    Hey I know the deferred shaders are in beta, but is there any support right now for touchbending in deferred? I can't seem to find the shader for it if there is. If not, is that going to be added relatively soon?
     
  5. kilju

    kilju

    Joined:
    Nov 4, 2013
    Posts:
    127
    hi all.
    i got problem with billboarding. looks like billboard doesnt show leaves only bark.
    any idea whats wrong?
     

    Attached Files:

  6. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    No one knows?
     
  7. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,523
    Makes the AFS shaders in that scene very glossy to look wet. Does not affect the treecreator shaders. Just the AFS Foliage shaders and the Afs Simple Tree shader.

    I would say you have the wrong shader for the leaves. Are you using the Afs Simple Tree or treecreator leaves optimized shader?
     
  8. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    OK. I didn't notice any difference and that's why I asked. I'll take a closer look.
     
  9. Maxell-Master

    Maxell-Master

    Joined:
    Nov 14, 2015
    Posts:
    3
    Hi Lars,
    I Bought 4.01 (great tool) but I can't update to 4.03 from asset store.
    I'm using unity 5.2 and with older version of AFS it crashes.
    is there any chance of a direct link for the update?
    thanks
     
  10. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,523
    The latest version of AFS requires Unity 5.2.1.
     
  11. Maxell-Master

    Maxell-Master

    Joined:
    Nov 14, 2015
    Posts:
    3
    thanks Baldinoboy for response
    I just update unity and AFS.
    I've another question, I hope someone can help me
    trees with afs can be lighted by a "backed" point light (not real time)?
    I made a try but it seems not working!

    AFS works only with real time lighting?
    Is there any kind of solution / workaround? like probe!

    Thanks!
     
    Last edited: Nov 17, 2015
  12. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,523
    I have used realtime lightmapping with the Foliage Shader v4. Works great. Use lightprobes for smaller vegetation and that works great too.

    Never used baked lighting though. Someone else will have to help you with that.
     
  13. Maxell-Master

    Maxell-Master

    Joined:
    Nov 14, 2015
    Posts:
    3
    Thanks again I got it!

    I've read somewhere that unity5 trees can't store light probe information generated by static terrain, and probably the shadow casted by tree is not stored into terrain lightmap. (don't know if is a bug, a missing feature or a people mistake)
    It seems that the only way is to place geometry trees + custom light probe. Only speedtree can store light probe info auto-generated by terrain!!??.
    really strange!
    I'm going to make some tests, but hope someone can help understand better, and if AFS can improve this features
     
  14. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,523
    Oh the Unity Terrain. Forget about it. Major problem with lighting and trees, billboards. A broken feature in Unity 5 unfortunately.

    I am using LOD trees, plants placed with Landscaper as Gameobjects. Both AFS Foliage Shader v4 plants/trees and treecreator trees. Treecreator trees cannot use lightmapping since the bending is stored in the UV2 but they can still pick up lightprobe information. Just not when placed with the terrain system.
     
    Last edited: Nov 26, 2015
  15. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    107
    I am having the exact same problem and can't figure it out.
    Did anyone ever get back to you about this?
    I tried adding global fog to the demo scenes and get the same result, trees as meshes look okay but the billboards look terrible. Utterly ruins the entire scene.
    If you check fog under light settings the trees look as expected but only the trees, fog doesn't work correctly in unity 5 for anything else.


    Anyone know how to fix this?
     
    Last edited: Nov 25, 2015
  16. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    295
    Does your grass on mesh tech support billboard grass? (ie grass that not only rotates towards the camera but also tilts up - we're doing a top down game.

    Similar to this - (watch at 3:00 for billoard vs non billboard) :



    We want to do something like this style, but we're not using Unity terrain. Not sure the best / cheapest way to do this.
     
    Last edited: Nov 27, 2015
  17. KarloE

    KarloE

    Joined:
    Aug 26, 2013
    Posts:
    175
    http://i.giphy.com/xTka04gxyD4fDxaDbq.gif

    Something weird is going on with my billboards, they bend up and down in regards to the camera and it looks really weird. I tried to tweak the settings script but no go.

    http://prntscr.com/9bfppl

    In general, nothing looks as it's supposed to, and I am not sure why. I imported the asset, and created an empty object, added the script to it. Am I missing something? How to make it work in my scene?
     
  18. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,523
    For the Billboards uncheck Align Billboards to Camera.
     
  19. Avonaeon

    Avonaeon

    Joined:
    Apr 17, 2012
    Posts:
    48
    Hey Lars, we recently had to downgrade to Unity 5.1.4 due to some issues with the newer version, and I was wondering if it would be possible to get AFS v.4.0.1 somehow? I'm sure if you can even download old versions of plugins on the asset store.
    Cheers,
    Daniel
     
  20. joe_ftg

    joe_ftg

    Joined:
    Nov 9, 2015
    Posts:
    50
    Hi, in the documentation it states that multiple objects can share the same Combine Children script. However, I noticed this can cause extreme wind behaviour on some instances of the children (vertices moving more than on other instances of the same prefab). It doesn't occur if only one prefab is used per Combine Children script, so it seems like a bug. Any thoughts?
     
  21. Epilol

    Epilol

    Joined:
    Jul 21, 2015
    Posts:
    85
    Hello, when I build the game I receive the error

    Shader error in 'AFS/Grass Shader v4': failed to open source file: 'Includes/AfsWavingGrass.cginc' at line 21 (on d3d9)

    Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN LIGHTMAP_ON DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON FOG_EXP2 IN_EDITMODE


    The game works on my computer with mac and on another computer with windows.
    But if I try to run it on my mac computer with windows Virtual Machine the grass is all pink (it looks like the shader is bugged or missing)

    I'm a bit scared to release my game as this behaviour might happen also on other computers.

    What should I do to fix this?

    Thanks a lot
     
  22. Epilol

    Epilol

    Joined:
    Jul 21, 2015
    Posts:
    85
    I got also many shader errors in the linux build

    Screen Shot 2015-12-22 at 15.04.04.png
     
  23. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    Unfortunately, I had to rate this asset as 1 star.
    1. The demos look awful in Unity 5 that I'm using (latest)
    2. The demos packed with the asset aren't the same as the ones that used to advertise the asset. How is that right?
    3. The support email just leads to Google web page
    4. Support isn't answering this thread
    5. There is no simple video tutorial. I'm a bit puzzled by this though, some other assets don't have them either. How hard is it to just record your computer while you do a basic end to end example? It takes like 5 minutes. You don't even have to talk.

    I'll happily change my rating when some (hopefully all) of these points are addressed.
     
  24. david55527

    david55527

    Joined:
    Mar 24, 2013
    Posts:
    58
    Has anyone found a solution for this yet? I've tried playing around with the billboard shader but I'm stumped o_O
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    yes. billboards are rendered as transparent objects. so they do not write to the depth buffer and will not receive any global fog added as image effect. you have to turn on fog in the lighting tab so fog will be enabled within the billboard shader.
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    rain let's you accumulate wetness on the plants’ surfaces (only works with the foliage shaders).
    you may even use the "Raindrop" shader variant to get dynamic raindrops on top of your plants.
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    hard edges indeed are a problem as the vertices get split (in case you use double sided geometry).
    so you can either use single sided geometry and the deferred shaders or edit the vertex color green channel of your models: set it to 0 to disable edge flutter.
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    billboarded grass is not supported, sorry.
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    hi there,
    i have just tested writing a built from unity 5.3.1 (mac using glcore) and unity 5.3.1.p1 (pc using dx9): both worked fine!
    but your error message looks pretty weird: "failed to open source file...". it looks as if some includes are missing or permissions have been corrupted?

    lars
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    hi there,
    sorry for my late reply: i have not been informed about any new post in this thread for several weeks... this happens from time to time but i do not know why.

    1. the demos look absolutely fine in unity 5.3.1. and unity 5.3.1.p1 – tested on pc and mac. so please explain what you mean by "awful" and post some screen shoots.
    2. i do not claim to have any content included you may see on any screen shoot used to show the features. but if you are looking for the bridge or the old barn: these are taken from the unity bootcamp demo (which should still be availble on the asset store for free). and i will add the red sphere :)
    3. the support email is the support email. i have no idea what you have clicked on or done. but it is: larsbertram69[at]gmail[dot]com
    4. see my introduction above
    5. it is not that simple and takes a lot of time. but you can find in depth written docs.
    6. do so!
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    you have to set the billboard shader to use alpha cut out instead of alpha blending so it writes to the depth buffer correctly. that gives you less nice edges because they will be harsh but that is the only way it works.
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    you may have to watch them closely. it might be subtle.
     
  33. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    I think it's because you stop posting on a thread. It stops alerting you after awhile.

    Please post a quick end to end video on you tube using just the asset. The edges to textures look entirely garbled on mine. I am using 5.3.1f1 I am just adding the demos to a scene and that's it.

    Yes, others do this and I rate them poorly as well. As long as you have substantial and accurate advertising material (youtube videos, untouched images) it's OK to include a few advanced use cases, but the first 4 or 5 videos/snapshots should only use the asset you're selling. Otherwise it's false advertising in my books. If you're just using the free assets, that's fine, though you can explain that more clearly.


    Well, there is now a mailto link in the asset. It was going to google.com before.


    Really? You're saying you can't do something simple with the asset in 10 minutes? I find this hard to believe, but perhaps with further investigation that will prove to be true. Right now I don't have any confidence the asset works so I don't wish to invest any more time in it until I do. A simple end to end video will help provide that confidence.

    You haven't addressed any of my important points.
     
    Last edited: Jan 3, 2016
  34. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    I can vouch for AFS - I'm using it extensively in my project and it works great. I do recommend taking the time to read the manual back to back though to understand how it works.

    As far as content included with the asset, I have to disagree with you there - this is a shader, not a content pack and an asset needs to show off it's potential. I don't think you're being very fair to the author here - this is hands down the best vegetation shader available for Unity and it is extremely cheap for what you get out of the box.
     
    Tinjaw and Baldinoboy like this.
  35. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    jdraper3, I don't know you, but you might be right. Unfortunately the demo scenes all look broken when I run them out of box. I'm sure the manual is interesting, but frankly, I am going to stick to my guns on a 5-10 minute end to end video (just start from an empty project).

    Once the video is done I'll be able to change my rating to 5 stars as I'll be able to follow along and verify it does what it claims to.
     
    Last edited: Jan 3, 2016
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    i would call it a bug in the forum... but maybe i have missed some notifications and then the forum stopped notifying me. anyway: annoying.
    i still do not understand what you want to say. a screen shoot might be helpful.
    this is how the basic demo scene looks for me in editor and i call it fine:
    demoscene.png
    there has always been that mailto link…
    i already addressed this. and becoming answered you demand for a video tutorial about his asset here: http://forum.unity3d.com/threads/horizon-on-make-your-horizons-look-real.259733/page-16#post-2439867
    as you wrote: he made some very good points. and i fully share his opinion: doing just a single change would make the whole video tutorial worthless whereas a written documentation can be updated in a rather small amount of time.
    not to mention that you can print out the docs, add notes etc.
    you can pull one of the prefabs shipped with the package into an empty scene and add the set up script. that is what you think a demo video should look like?
    or should it show how you just tick a checkbox to get camera aligned billboards?
    would you like to see how i manually place grass to the scene?
    and if you step back and have a look at the title of the package it is mostly about foliage. so let’s take a look at the foliage shaders: they need your model and textures to be properly prepared unless you use the foliage tool to set them up: even this would not be covered in a 10 min video. but it is addressed in the documentation which even describes the used bending functions.
    i have addressed a lot of those:

    1. i can not confirm any strange look on any machine a have tested the package with (mac/pc and unity 5.3.1 and 5.3.1.p1). i have posted a screen shoot showing how it looks for me and is intended to look. you have just been claiming that it looks odd. screen shoots?

    2. i may make it more obviously that the links to the webplayers show content which is not included in the package.

    3. support email has always been there as far as i know. last update of the package was on october 19th. if it is there now it is there at least since october.

    4. i explained why i haven’t answered on the thread and apologized for that. it is up to you to take it or not.

    5. afs has a written in depth documentation. it might be great to have some videos but i can simply not handle that. i rather like to concentrate on the further development of the package and taking care about updates of the unity rendering pipeline to make it work with the latest release than updating you tube videos every 4 weeks.

    but in case you want a personal introduction you can contact me via email or through the forum (like many other people have done before…).
    maybe we can find some time to do a skype call.
     
  37. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    I just import the asset, click on the demo, and press play. This is what I get:

    And, I'm sorry, but I'm skeptical about the tutorial video. Perhaps if some other people chime in and say it's impossible to do anything simple in 10 minutes, I'll change my mind.
     

    Attached Files:

  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    @blazespinnaker:
    glad you came back.
    that is a very tiny, tiny screen shoot :)
    but i guess i see what you mean: alpha is jagging?
    i have tried to capture more or less the same. this it how it looks for me:

    afs_textures.PNG

    this is unity 5.3.1.p. forget about about 5.3.1.f1 as it is totally broken and get the latest patch.
    but i doubt that it is just the patch.so what hardware are you on? i am using windows 10, dx9 as you can see on the screen shoot, nvidia gforce gtx 970m and latest drivers from december 2015.
     
  39. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    When I click on check for updates it says the unity editor is up to date. Is your asset tool only compatible with certain graphic cards? I ran that on a win10 laptop. Should I try with a desktop machine? I'll need a tool that works on laptops as well. Perhaps you could explain that is a limitation for people who are about to buy.
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    i run it on a pc laptop too.
    and the asset should be compatible with more or less all sm 3.0 gpu (as quoted) – but who knows? drivers of some vendors might be very buggy. but i have tested it successfully on nvidia, amd and intel gpus on various os.
    check for updates won’t show you the latest patch versions. but there is one newer than 5.3.1.f1 which is 5.3.1.p1.
    you can get it from here: http://unity3d.com/unity/qa/patch-releases

    but back to the alpha issue. doing a proper alpha cutout is sooooo basic that i can't believe it is a driver issue.
    maybe your download is corrupted... so please do a quick test a switch the shader of the banana from afs to standard -> then choose ""Cutout" as "Rendering Mode". if alpha still gives you some jagged outlines it is either your driver or the import settings of the textures.if not i have got a problem and would need some more information.
     
  41. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    My download is corrupted? Are you serious?
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    yes i am.
    have you done the test i supposed?
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
  44. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    I deleted the AFT script and set the shader to standard. There is no longer any 'alpha cutout' issues as you call them.

    Honestly, I'm happy to help you debug your scripts, I really am. I am excited about using your product and I'd love to give you a 5 star rating. I think if you help me out here with just a basic you tube tutorial I think you'll find that not only will you make me a very happy customer, you will attract a lot of other new users as well and your 5-10 minutes of video will probably reap $1000s of dollars over 2016.

    I can assure you, there is a large silent group (for fear of looking dumb) out there that is excited about using what you have but is new to unity and doesn't know how to leverage what you've done.

    In particular, your price point is probably more suited to new unity users rather than professionals so I'd think it'd be a pretty easy decision.
     
    Last edited: Jan 3, 2016
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    willing to have a skye call?
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    and btw: the advanced foliage shaders are used by broad range of rather professional developers.
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    well, i can not take this seriously anymore as you just logged off.
    if you still have that specific problem contact me via email or pm.
    in case you do not i will file all this under: immature.
    that is not the way i usually handle customer’s feedback but in this special case i do not see any other possibility:
    i tried to contact you via pm: no reaction.
    i have tried to cook it all down via pm: no reaction.
    i have tried to initiate a personal skype call: no reaction.

    i do not know what is driving you. but i guess finding a solution is not.

    lars
     
  48. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    I am perplexed that you want to spend all this time (by my count, probably about 30 minutes plus now) trying to solve a problem in a way I don't want it solved, but don't want to spend 10 minutes recording your computer doing some end to end basic usage of your asset. At no point did I really ask you to solve the alpha cutout issues. What I wanted to see was the asset being used end to end so I could build confidence. For me, it will be worth it to see the workflow of someone who is as highly skilled in shaders such as yourself, which is why I keep asking.

    What possible reason do you have to not do it? I am perplexed.

    I also understand professionals use your tool and that's why I selected it. However, your price point is very attractive to new users.
     
    Last edited: Jan 4, 2016
  49. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    I thought it was pretty obvious by now. I really wanted to see an end to end video to build confidence in using your product.
     
  50. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,523
    I do not understand what you want a video for. This is not terrain composer. The most work you need to do with this asset is not even in Unity. It is in Photoshop/GIMP and your modeling software. All that would be a lot more than a 10 minute video and it is not even Lars' job to show you how to use Blender or whatever you are using! In Unity it is quite basic. Apply the shader-put in the textures-apply the desired script. The components are so straight forward. Especially if you read the doc.

    If you actually communicate Lars will help you out. That is what he did for me. I am not intelligent so he walked me through everything be it in a conversation or Skype. Reading the docs is enough for most people. I can not help you out on the programming side but I will and have tried my best to help out people having difficulty with setting things up.

    The only time I saw that artifact was when I tried a build on my old laptop. The thing is dying and it was displaying these lines on the leaves similar to what I saw in your screenshot.

    The thing is Lars does not have to make a tutorial video. It is not required. People who want to use great looking trees in Unity will purchase AFS if it has a video or not. If they are having problems they will be and have been sensible and contacted Lars. Even though it took time for a Lars to respond if you asked for help about your problem with etiquette instead of threatening we users would have helped you. The community is pretty awesome so have respect and patience for people and they will help you out.
     
    Tinjaw likes this.