Search Unity

Advanced foliage shader [released]

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

  1. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266


    I've turned up the lighting quite a bit to demonstrate as not so clear to see in non-VR. It doesn't actually look like back faces but particular meshes are black.



    These are all the same Prefab GameObject.
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    hmm that might be cuased by several things or settings.
    - have you checked healthy and dry color in the combine children script? is one set to black?
    - have you checked the normals? switch to deferred than preview the normals after combining in the scene view.
     
  3. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    Healthy & dry color both white.

    When I combine statically in scene view normals looked good. After combining in scene view and then hitting play the black was gone and they look great! However, I would still prefer to combine on start.

    When I try and have combine on start (not combined in scene view) the disappear issue is back! The meshes are marked as static and have lightmaps baked.

     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    oh, if you mark the grass as static in order to enable lightmapping it must NOT be set to batching static.
    this should throw an error because the meshes are already statically combined.
    so either combine in editor (i usually copy the whole parent object incl. it grass children, then deactivate the copy. then statically combine the original. if you need to rework anything. delete the original. enable the copy and copy that again...) or – mark the mesh as NOT batching static!
    but you can't lightmap grass umnless it is combined as it does not have proper uv2... so comine the grass statically in the editor.
     
  5. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    OK cool thanks for pointing that out for me. So my best course of action (for performance and lovely lightmaps) is to combine statically in the editor, mark the combine parent as static and bake lightmaps?
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    you do not have to mark it as batching static. you may though. just try outand find out what is best for performance.
    in order to make lightmapping work you just have to check lightmap static.
     
  7. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    HI, Ok I'm happy with that solution and the results :) Thanks.

    I've moved onto foliage, just dropped in the Fern Bracken Prefab and finding that I have a similar issue with very dark faces:

    https://gyazo.com/1e6ee5fdad027e4fbd4ebf949c2914e9
    (Unity forums not liking this gif for some reason)


    When you view from behind the translucency works really well but when you are perpendicular to the face (and the light source) it appears very dark.

    Also is there a similar operation to that of Combine script that you can use for foliage? Or any other optimizations we can employ? Or is it simply, drop the the GameObject in and that's it?

    Thanks for your help!
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    lightmapped?
    translucency does not work with light mapping.
     
  9. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    OK well I'm running real-time lighting at the moment, haven't got onto the lightmapping part. But I'm still having issues with these dark faces.

    I'm also trying to configure my own fern. I've painted on vertex colours like so:








    (Alpha)

    But I'm getting very left/right movement:



    Is there a way make the affect more up/down or a way to control this? I don't seem to be getting any bending either? I'm added the Afs Foliage Tool and saved the mesh. I've read through the docs on the Foliage Tool but it isn't very clear to me what the sliders do or the animation curves.

    Thanks, Jake
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    hi jake,

    your vertex color looks weird.
    assuming that yu are using the new and recommende vertex color only mode colors are used as following:
    red is phase. it should have the same shade for one leaf – but different shades for differnt leaves so the move slightly time shifted.
    blue is secondary bending – an up and down movement for leaves: it should be a gradient from the pivot of the left (black) to the tip (some shade of blue).
    green is edge fluttering. that looks fine.
    alpha is primary bending. it should be a gradient from bottom (black) to top (white).

    the movement of the fern looks like if you haven't enabled instancing. so the shader uses the wave size as defined by the setup script. that seems to be set to a pretty small value for the foliage shader. try to raise it to something like 5-8m. that will give you less distortion within the fern.

    dark faces: right now i have no real idea what might be causing this. but please keep in mind that the shader does not animate the normals. so if your fern is heavily distorted by the wind lighting will be completly wrong as it is calculated based on the none animated normals...
     
  11. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    Hi, thanks for the continued help.

    It looks like the blue channel is really sensitive on my fern, putting this down starts to give some better results. However it doens't seem so much as an up/down movement as a pull to one side? Is there anything that controls the direction of that movement?

    Thanks
     
  12. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    456
    Hello Lars,

    in your demo scene, the tips of the fern looks overly bright.
    When I switch to Def / Linear, it gets better, but it still doesn't look right.

    Can you have a look?
    And can you update your asset?
    Current release is for Unity 3 and I wonder if the asset isn't supported anymore.
    Also, none of your dropbox examples are working any longer, and screenshots in your initial posts have long been removed.
    Whenever I visit this forum, I'm never sure if your asset is dead or not, but then I see that you updated your support mail and your website URL.

    Thank you.

     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    nope... that is hard coded.
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    afs is now at version 5. and it still alive.
    you may have to update though.
     
  15. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    Hi again!

    I noticed my Foliage Shader leaves take on a strange yellow/white ghost when they are being effected by any additional light source. The material preview itself seems to have something similar going on.

    As the foliage waves and shakes in the wind, the ghost seems to move along with it only at it's own rate. It's almost like there are two planes there inside each other because sometimes they will clip through one another. Here is what it looks like:



    I checked to make sure I didn't have any double geometry but other than that, I'm not sure what to do.

    Would anyone happen to know what's going on?

    Thank you!
     
  16. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    Hi Lars,

    Moving onto trees. I'm just trying to get the conifer prefab working nicely in my scene (night lighting). I'm finding that viewing from side that the moonlight hits looks good:



    But if you looking through the tree into the moonlight it is very light:



    I'm guessing this is the translucency? Is there a way to change this? I'm finding I can't find the Leaves material in the tree editor too, shouldn't it be under Geometry?



    Could you please address this question too:
    Many thanks! Jake
     
  17. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    I noticed this is not an issue with a previous version of AFS (v 5.0) unless I enable Instancing on the material - in which case I see the same ghost effect. In 5.03, enabling instancing removes the problem but I loose all my leaf shaking movement and just get a flat kind of wiggle back and fourth.

    I tried just copying the "AfsFoliageShader (instanced)" over from my older project to this new one but I didn't see a change. There's probably more to it than just that shader but I can't really say.

    I've also messed with just about every switch and toggle in the project, camera, light, and material settings but haven't been able to loose the unwanted effect.
     
  18. ch0arrim

    ch0arrim

    Joined:
    Jul 18, 2012
    Posts:
    10
    Hi,
    I recently bought this shader and I also bought the Isometric Village 3d thinking I could use your asset to make the trees more alive. But when I add you shader setup script and then try and change the trees materials to the afs shaders, the trees and plants seems to move and bend all over the place???

    The trees look like this:
    upload_2017-8-26_12-14-53.png

    and when I change the shader for either the leaf part or wood part the plants will look like this:
    upload_2017-8-26_12-15-43.png

    Which make the plants go all over the place. Am I missing something here? is the tree not compatible with your shader? Or do I need to make any settings to make it work? I tried to use the default values first and even try and lower the wind setting but that helped very little.

    Please help!

    /Best regards
    Daniel
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    hi daniel,
    i don't know the isometric village package. so i can't tell you if its trees are compatible with afs or not.
    all afs shaders need bending information baked into the meshes. you can either use tree creator trees and the proper afs tree creator shaders. or you will have to edit your plant meshes. you can do so manually in your 3d app or use the foliage tool which ships with afs. please have a look at the documentation.
     
  20. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    Generally when you pop an Afs shader on a mesh with no vertex color, it will cause some wacky bending before you adjust the values with the Afs Foliage Tool (Script) and the AFS Setup. It's well worth reading through the documentation to understand what Afs is doing to your mesh and explore your options for tweaking the bending from there.

    From what I can tell from your post, it looks like there is no Afs Foliage Tool (Script) on your mesh to control the bending so you get the extreme look you are seeing. It's not common to have vertex color information from asset packs unless they are using special shaders as well so I don't think that's the case.
     
  21. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    857
    Hi Lars,

    I'm getting this error when building for PC. It's not a complete show stopper as it only fails the first build any time I use unity but not sure if it has other issues from extended use for example. Using unity 2017.1

    Shader error in 'AFS/Foliage Shader': texld/texldb/texldp/dsx/dsy instructions with r# as source cannot be used inside dynamic conditional 'if' blocks, dynamic conditional subroutine calls, or loop/rep with break*. at line 178 (on d3d9)

    Compiling Fragment program with DIRECTIONAL LIGHTMAP_ON EFFECT_BUMP AFS_TOUCHBENDING
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    there is no if + texture read in the shader - so i assume it to be a bug in shaderlab.
     
  23. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    182
    I was interested in getting AFS v.5 but couldn't find anything to indicate if it will work on the PS4 and XB1. Also, I'm using Relief Terrain Pack and wanted to make sure this would be compatible with that pack. Thanks.
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    it should.
    in case you are not limited by using rtp's deferred lighting shader to give you old blinn phong specular lighting it should be just fine.
     
  25. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    182
    Thanks for the quick reply. I'm not sure what you mean though by "in case you are not limited". I haven't started working with RTP yet so I'm not that familiar with it but I would like to use it for the actual terrain and AFS for grass and trees. I just wanted to make sure that should be possible.
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    then you are not limited :) and everything should be just fine.
     
  27. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    Has anyone had a chance to consider my post here? I haven't been able to find a fix. Switching to "Differed" Rendering path removes the ghost issue but that conflicts with many of my other shaders so I can't commit to that.

    I've rolled back to AFS v.5.0 by making a backup and replacing the package contents with those from my old project which seemed to work but I would like to know if there is a better solution. By doing so I noticed the Camera Depth Normal Texture now causes a similar ghost effect unless in Differed rendering as well.

    Thanks :)
     
    Last edited: Aug 30, 2017
  28. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    Something else that I'm noticing with this new version is as I move towards and away from my trees, the light transmission through the leaves will get dark and light again. Looks kind of like a shadow is passing over as I change distance. In my old project, the light transmission effect on the shader was consistent and did not loose it's luminescence in this unusual way. Switching to "Differed" rendering path does not fix this issue and my old project is using Forward with no problems.

    I updated my old project to 5.03 and noticed a similar occurrence but at a much greater distance. I pull the camera away and after a while the foliage takes on the shadow then the shadow passes over and the light transmission comes back in full strength. The ghosting effect I brought up in my previous post also returns with this update.

    P.S.

    In my last post I said rolling back to v5.0 seemed to work but it actually caused a lot of quirks and problems with how the shader was looking.
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    translucency fades out towards the billboard distance.
    it should not fade out and in again?!
    there should not be any ghosting. which version of unity do you use? and which version of afs?
    you are using forward – and dx11 or dx9? or something else?
    have you checked if the correct depth normal shader is assigned and that is does not get overwritten by any other shader?
    you also may try to disable dynamic and static batching.
     
  30. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    My custom trees aren't using billboards as part of the LOD setup so I haven't gotten into those elements of this package. Is there a parameter I need to set manually? What makes me unsure is that I'm using the same setup in my old project - Unity 5.6.3p1 Personal using AFS v5.0 - and its working as expected.
    Unity 5.6.3p1 Personal along with AFS Version 5.03
    That's right, I've been using Forward and working with DX11. Switching to Differed fixes the ghost problem but the translucency fade issue persists. Switching to Differed rendering path would create other problems so I'm hoping that won't be the case.
    I gave this a shot and made a build but saw the same effects as in the editor - both the ghosts and the translucency fade out and back in as I move the camera out.
    Switching to the AFS depth normal shader does not correct the issues I'm experiencing unfortunately. I'm not sure how to tell if it gets overwritten though. If you elaborate on that, I can check it out.

    Thanks for getting back to me and let me know if there is any more information I can provide for you!
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    let's tackle this one after the other.

    ghosting
    i created a new project in unity 5.6.3 on windows 10 pro (laptop with nvidia gtx 970m).
    • then i downloaded and imported the latest version of afs and the postprocessing stack.
    • i set the project to linear
    • set the camer to forward
    • switched to grahics settings -> debug mode and assigned the afs depth normal shader (tokk me 2 trails as i first forgot to switch to "custom shader" before dragging the afs shader to the slot...)
    • i opened the foliage shader overview demo, cranked up main wind to 3, added the post processing stack, activated ao, set it to intensity = 4, sample count = high, downsampling = unchecked, force forward compatibility = checked
    • then i hit start
    • no ghosting as far as i can say.
    grass went crazy. but everything looked allright.

    that is a screen shot from game view:

    regular.PNG


    and thatis the ao debug view:

    ao.PNG

    as far as i can say they both fit pretty well. so no ghosting as far as i can say.
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    I ASSUME THAT YOU STILL UESE THE AFS TREE CREATOR SHADERSß
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    i assume that you still use the afs tree creator shaders?
    these will fade out translucency towards the given billboard distance.
    assuming that you use the foliage shader instead translucency will fade out according to the "foliage specular and translucent lighting settings" in "lighting settings" of the afs setup script.
     
  34. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    I'm going through all the points you are making now to be sure we are on the same page but in the mean time, could you add a second directional light to the scene or a point light near some foliage and see if you see any ghosting? That's when the ghosting is most apparent; when there are extra lights in the scene.
     
  35. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    The exact shader I'm using is the "AfsFoliageShader (instanced)" not the tree creator shaders. I thought those were for the Unity tree creator trees and they didn't seem to look right on my mesh so I picked the the regular AfsFoliageShader. The tree creator shaders do not show ghosting or the lighting distance issue but they don't have the desired effect with my single sided geometry.
    I hadn't seen these parameters before but playing with them does change at what distance the fade happens and how long the fade lasts but regardless of these settings, after a distance, they will brighten back up. At this point I'm testing on a Unity primitive cube to rule out my geometry or tree setup. I still see the the light fade and ghosting on the cube.
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    no ghosting: but are you crazy? do you know what this means in forward lighting? it will be incredibly expensive. do not do this please.
    adding a point light also does not cause any ghosting.
    both are not related to ambient occlusion anyway.
    older versions of unity only tended to calculate wrong lighting in forward in the different lighting passes due to slighly different matrices – but that is fixed since...? at least it is fixed in 5.6.3.
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    i can not confirm this.
    shadows however fade out at a certain distance...
     
  38. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    I don't know anything about the difference between the two rendering paths so I just leave the default. It seems to work better with my other shaders as well so changing would be a pain. I'd really appreciate it if you would help me work this out regardless of the rendering path I chose. After all, it was once working great for me using Forward rendering.
    Here is a video I made so you can see what I'm seeing. It's comparing my first project then my current project using the previous version of AFS and the new one. In both parts I first show the lighting range fade then I show how adding a second light effects the shader. In the first example, everything works the way I would expect; light fades out at a distance and the extra light causes no ghosting. In the second half, you can see how the distance light fade comes right back in once's faded out like a reflected gradient rather than a completely linear gradient. And the added point light causes the ghosting I have been seeing.



    After making this video, I created a new project entirely, downloaded and imported AFS 5 v5.03 and nothing else. I changed none of the project settings or anything and created a cube with an AfsFoliageShader (instanced) material, gave it the AFS foliage tool script, placed the AFS Setup in the scene and got the same results that you see in the later half of the video.

    Thanks for your help so far! I hope this clears stuff up and makes it easier to track down what's going on.

    P.S.

    I don't know why but I feel like it's worth bringing up that in the material preview window of my AFS material, I see a scrambled up sphere with my evergreen texture on it in AFS v5.0. However in AFS v5.03, I also see the white/yellow ghost squished into the preview. You can see it in my video. Not sure what it is but maybe it helps to acknowledge?
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    thanks for the video. that helped a lot.

    translucency fade
    in fact you found a bug...
    in order to fix this edit the foliage shader and find:
    v.color.b = saturate( abs( _AfsSpecFade.x (...)
    and simply remove the "abs":
    v.color.b = saturate(( _AfsSpecFade.x (...)

    ghosting [edit]
    i thought you were talking about incorrect depth and ao. but your problem is caused by the the forward add pass.
    you simply have to manually enable instancing in the material editor to mostly* get rid that ghosting.
    unfortunately unity decided to disable instancing by default – even if the shader is set to use it...
    *unity 5.6. seems to have changed the way matrices are handles again. so even if instancing is enabled the forward add pass (used by the point light) does not 100% match the first pass (directional light) which causes some flickering. i will have to deactivate some afs features to get that fixed.
     
    Last edited: Sep 1, 2017
  40. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    Fantastic! This fixed the fade for me :) Thanks so much for looking into that!
    I've tried this before when I saw the caveats to 5.6 you pointed out in the documentation and while it does remove the light ghosting, it also removes all of the foliage fluttering movement making the leaves mesh look like a single stiff object rocking back and fourth. This happens in both of my projects (with AFS v5.0 / v5.03).

    I'm glad the video helped last time so maybe this will make things clearer as well. I'm in my current project showing the effect of instantiating the material as described above:



    Maybe it's also worth mentioning that in my old project (AFS v5.0) when I enable instancing, things go stiff as well but it actually causes ghosting where as in this video, you see the stiff movement eliminating the ghosting.
     
    Last edited: Sep 1, 2017
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    disabling instancing makes the shader expect that it has to deal with dynamically batched objects (no matter if they actually are dynamically batched). those would be just a vertex soup with not information about the original pivot of each instance.
    so if instancing is disabled the shader falls back into an old style bending mode that does not rely on pivots but just creates some noise and wind waves. the size of these waves is controlled in the afs setup script.

    i assume that this is what you described as "foliage fluttering movement".

    in fact adding vertex colors to your models should give you much more interesting bending even if instancing is enabled. you can do this way more precisely by hand than the foliage tool can do as you know about branches, pivots etc.
    - add vertex color green to the outer tips of the branches to add high frequent edge fluttering.
    - add vertex color blue (a gradient from the branches' pivots (black) to the their tips (some shade of blue) to add secondary bending.
    - add different shades of vertex color red to the different branches in order to get some variation in phase.
    - add vertex color alpha to add main bending.

    you may tweak these values with the foliage tool later on.
     
  42. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    Okay, I had a feeling that was the case. I just read further up that you recommended this method.

    I'd be fine using the vertex color method however I have such a large amount of unique plants in my project. To go back and give each of them their own vertex color information would be a large undertaking all by myself. I would much rather have the option to use the vertex color method rather than the necessity.

    Is there any way I could revert some changes made in v5.03 myself to eliminate this ghosting effect? I'm sure it's more complicated than I could imagine but it's worth asking for alternatives. I've tried importing v5.0 from my other project but that doesn't quite work the way I would expect.
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    you would have to edit the "AfsFoliageBendingInstanced.cginc" file:
    you have to find all:
    #if defined(INSTANCING_ON)
    ...
    #else
    combinations and revers them. or simply comment the if branch and only keep the else one.
    then you can enable instancing and keep the old wave driven bending.
     
  44. AcornBringer

    AcornBringer

    Joined:
    Mar 22, 2015
    Posts:
    57
    I gave it a shot and to the best of my knowledge did as you explained but I'm seeing the same type of stiff bending when I enable instancing. Out of pure curiosity, I deleted all the contents from that shader and hoped back into the project and saw no changes to how things look with or with out instancing set in the material.

    Maybe you could send me a modified AfsFoliageBendingInstanced.cginc file I can replace mine with.
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    i forgot to mention that you have to reimport the shader after editing the cginc file..
     
  46. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,015
    Thanks so much for making (and updating) this package!

    Couple questions:

    1) What is the difference (in rendering and performance) between Tree Creator Leaves shader and Tree Creator Leaves Optimized? The former seems to have a bit more AO and look a bit nicer, but I can't really pin down the visual difference.

    2) When I choose Tree Creator Leaves shader, tree billboards have no leaves at all, just bark. Any idea what I'm doing wrong?

    3) Is there any way to darken the billboards? Ideally they'd have some AO to match the mesh trees, but short of that, I'd like to darken them a bit so they match the average color of the mesh trees.

    4) I'm probably only going to use the Tree shaders (likely use uNature for grass). Are there anything I should worry about in the AFS Setup (interfering with uNature, needing to be zeroed out, etc.)?

    thanks!
    Dave
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    hi dave,
    the first one usually is only used to setup materials for the tree creator. the second one will be used in the final tree.
    it uses combined textures and therefore should be faster and less memory hungry.

    see above. only the optimized shader is "connected" to the shader which creates the billboard textures.

    no official way... btw. billboards include ao. if you want to darken them you can either tweak the rendertx shaders and multiply the final color by e.g. 0.9 or you may edit the billboard shader and do it there.

    nothing which i would be aware of.
     
  48. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,015
    Thanks for the quick reply!

    Hmm, if my tree billboards have AO, it's pretty subtle:
    trees.png

    Can you tell me a bit more about what/where to tweak that?

    And now I notice that the AfsBillboardTree Transparent shader didn't import properly--it's a blank file icon/inspector. Reimporting it doesn't help. Is that used here? (AfsBillboardTree CutOut is imported as a shader.)

    thanks!
    Dave
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    4,845
    to me it looks as if the darken areas on the mesh trees are caused by real time shadows because they have a directionality.
    the tree creator bakes ao to vertices. and usually it is quite subtle, yes.
    but it should be equal on billboards and mesh trees.

    looking at your screen shoot i think you do not have to tweak anything. billboards pretty much catch up. they just do not receive or cast any real time shadows. to try: just disable real time shadows.
    if you still have the impression that billboards are too bright we can go deeper into that.

    it is disabled. afs default billboard shader uses cutout.
     
  50. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,015
    Thanks again for the quick reply and all that makes sense. Yes I do want to have realtime shadows, so can you explain more how to darken the billboards so they match the mesh better? (Distant forests are generally a bit on the dark side anyways.)