Search Unity

Advanced foliage shader [released]

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

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    well, i would say: physically based shading does not really work if you do not cull backfaces and render single sided geometry as it would be double sided – unless you use a double pass shader: but it is not easy to write such a shader as a surface shader not to mention that it would probably more expensive than copying and flipping the faces.
    personally i can only think of one single case it really would be needed: when using unity’s cloth component.

    what exactly would you need such a shader for?

    lars
     
  2. TimBorquez

    TimBorquez

    Joined:
    Mar 18, 2013
    Posts:
    81
    it's not a big deal, I was trying to do vines, you're right I probably wouldn't need it because i can make them billboards.

    one actual problem I have run into recently though is I have painted grass on a level, and if i look up/down the grass moves up/down, i don't know what setting i messed up...

    it only happens after i combine the grass with the combine children script
     
    Last edited: Jul 22, 2014
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    sorry, my answer is not really correct as i though this was another thread:
    of course the grass shader uses single sided geometry (and does not cull backfaces).
    but it has a lighting function which only fits grass/grass like plants (as it lights the object according to the underlaying surface’s normal).

    vines should be double sided and use the foliage shader.

    never heard of something like this before...
    which shader do you use with the grass? is it manually placed? and do you use the combine children afs script?

    lars
     
  4. TimBorquez

    TimBorquez

    Joined:
    Mar 18, 2013
    Posts:
    81
    i am using leafs optimized, i painted them with your geometry brush (awesome by the way :D), it doesnt happen with all of the grass alone as seperate meshes, but as soon as i use combine children it happens, and it's ONLY happening in this one scene, strange... i have used the same method in many other levels without problems



    i can remake my scene as it is only happening in one level, I just was wondering because if theres a setting i messed up it would be good to know haha (so i dont do it again)
     
    Last edited: Jul 22, 2014
  5. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Did you add the setup afs script in this scene? Not sure if that could cause this.
     
  6. TimBorquez

    TimBorquez

    Joined:
    Mar 18, 2013
    Posts:
    81
    yup i have it on an empty gameobject
     
  7. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    I had this problem when I used manually placed trees using the tree shader. I got rid of it by increasing the Billboard Start and/or disabling align billboards to camera in the afs script. That was using the tree shaders though.
     
  8. TimBorquez

    TimBorquez

    Joined:
    Mar 18, 2013
    Posts:
    81
    i disabled align to camera and that fixed it :) thank you good sir, odd that it broke on this level as that option is on on all my other levels
     
  9. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Cool. Not 100% sure but it might be because the origin of the grass when you combine them is further away from the camera than it is in the other scenes and the afs script tells that bunch of grass to billboard. Glad it worked.
     
  10. broesby

    broesby

    Joined:
    Oct 14, 2012
    Posts:
    118
    Hi Lars,..

    Thx for the comprehensive answer on tree colliders..... I will look into it sooner or later ;-)

    For now I am struggling a bit with the basics of AFS - tree billboard tranisition.

    I did as mentioned in docomentation swapping out the materials for the Tree Creator trees.... so on... For one of my trees I even took the Pine IBL in your demo package.

    But the trees turn all black when the go from billboard to mesh....
    Until very close. Then they make the transition finally :-/

    I am very sure it has to do with the billboard start + fade length values and I tried to sync them both manually and in AFSsetup script... but no success.

    I have to say that my trees are placed with Terrain Composer on which I am totally dependent.

    Not the same problem when I play the demo scene inside same project, btw
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi tim,
    sorry, but you should not use the "leafs optimized" shader on grass!
    "leafs optimized" is for trees created with the built in tree creator (and placed using the terrain engine). it is pretty complex and expensive and needs "trees" to render correct bending.
    from what i can see in the video you do not need complex lighting on grass (like translucency or specular relfections) so using the "leafs optimized" shader is absolutely useless.
    for this reason i highly recommend to use the advanced grass shader.

    lars
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi broesby,

    i am not really sure what causes your problem.

    to test if your trees really use the correct shaders you may enable IBL (in the setup script) and then chnage the "camera exposure". if mesh trees and billboards (you have to rotate the camera slighly to make the billboards to be updated) do NOT react to the changed "camera exposure" they do NOT use the right shaders.
    so either some other package overwrites the billboard shader or you haven’t assigned the mesh shaders properly.
    but if it works the right shaders are assigned. in this case i would follow you and say: there must be something wrong with your setup. please go and check the demo scenes then: look if you have checked "automatically sync with terrain" and if you have assigned the terrain correctly.

    lars
     
  13. TimBorquez

    TimBorquez

    Joined:
    Mar 18, 2013
    Posts:
    81
    alright I'll change it, I am still newish and bad at using this stuff...(for some reason I didn't see a grass one in the list before, found it now)
    thanks
     
    Last edited: Jul 23, 2014
  14. Panos-Heli

    Panos-Heli

    Joined:
    Jul 23, 2014
    Posts:
    2
    Hi Lars,

    I have made a scene with 800x600 terrain full of foliage with Advanced foliage shader. The problem is that unity crashes and gives me a memory error. All foliage are manual placed and i have separated them in 18 groups. Is anything i can do to resolve this issue?
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there.
    duplicate your scene.
    then try to combine the groups statically and look if the script throws any errors.

    lars
     
  16. Panos-Heli

    Panos-Heli

    Joined:
    Jul 23, 2014
    Posts:
    2
    thank you for the fast reply!
    You are right, for each group that i have combined i see these errors:
    Errors.jpg
    What am I doing wrong? Hmm...
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi panos,

    no mesh can have more than 65000 vertices (limited by unity). so it seems that you have just added to many objects to each cluster.
    you should try to break up your clusters and spread your objects on may be 100 instead of 18 clusters.
    as your terrain has dimensions of 800x600 meters you should in fact have about 2000 clusters anyway... if you use clusters of a size about 15 x 15 meters.
    the larger the clusters the less the number of draw calls but culling will not work efficiently: even if there are only a view pixels of the cluster which are visible the whole cluster will have to be send to the gpu, rendered and mostly skipped in the shader. as most foliage shaders always use forward rendering this might be very expensive...
    so you will have to find the right balance between draw calls (large clusters) and lately skipped vertices due to the size of your clusters: smaller clusters will make culling more efficient but raise the number of draw calls, larger clusters will reduce the number of draw calls but probably waste a lot of bandwith.

    lars
     
  18. Astragoth

    Astragoth

    Joined:
    Apr 29, 2014
    Posts:
    3
    Hi Lars,

    Your last post was very interesting, thank you. You mention 2000 clusters..Will the Editor be able to handle 2000 clusters? I noticed that after using a lot of clusters, (ummm 18 clusters....) and then clicked on play, it would take a very long time to compile and then sometimes it would crush. Then again, the clusters had A LOT more objects than they should, and maybe that is why.

    So, do you believe that it is possible to cover such a large area, with no performance compromises, with a high number (300+) of clusters of less than 65k vertices each?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    performance compromises – well, if you do not have have a decent streaming solution you will always run into problems: memory consumption and bandwith.
    personally i always use the built in terrain engine to lay out large areas of grass (using a rather low detail resolution: about 1x1 or even 2x2 meters precision) and only add some small clusters of manually placed grass at areas where i really need 100% control over the placement and rotation of each single instance.
    using culling layers this really gives me a very nice framerate and perfectly positioned grass.

    lars
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the combine children script creates as many submeshes as materials are assigned: so in case you do not use texture atlases it will create multiple objects/meshes. but if you follow the docs and create one big texture atlas shared by all objects it should just create one big mesh (at least if all of those use the same shader). if you have objects using the grass shader and objects using the foliage shader e.g. the script will always create 2 meshes. that is the way it works.

    lars
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902

    hi jesper,
    on the dev blog of play rust i found the entry posted below about how they "solved" the colliders problem.
    not as elegant as using a pooling solution i guess but may be easier to implement:

    http://playrust.com/friday-devblog-16/#more-1012

    Colliders Workaround
    We’ve had a problem in Rust since we added building. People build too much. In Unity there’s a collider limit of 64k and with 100 people on a server we can hit that easily in about 10 hours. Unity5 uses an upgraded physics engine – so this is fixed, but Unity don’t love us enough to give us Unity5. So in the old version of Rust there were a few hacks to help us overcome it. At the start of the game all the tree’s colliders are merged into one big collider. That’s why we can’t remove trees in that version. That saves about 5,000 colliders. Next when you’re building all the connected colliders are merged. This works but it’s a hell of a lot of F***ing about to make it work and even more F***ing about to make it work without lagging the server. Then you have the problem of a player shooting an object – it’s hitting a compound collider.. you need to find out which object it actually hit.

    So F*** that S***. You can become a slave to workarounds like this.

    In this version the world is divided into a grid for network reasons. A player is only sent the objects in adjacent cells. So because they’re already in a grid we can look at each object and say.. there’s no player subscribed the cell you’re in.. so turn your collider off. And this works so far. It’s keeping us well under the limit. The limit is still there but hopefully this cheeky fix will hold us off until Unity5 comes out.
     
    konsnos likes this.
  22. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25
    Hi Lars,
    i have a little problem to convert trees from unitys tree generator. I follow the doc, but may be i'm too stupid...
    See the pics, left the tree from the generator - right after the rebuild with the AfsFoliageTool. What do i wrong? Do you have a step by step tut where i can follow the steps?

    Tia, jochen
     

    Attached Files:

  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi jochen,

    unfortunately i can not enlarge your pics so i can only guess what they show: leaves are not rendered transparent cut out.
    have you changed the used shader to "afs simple tree" or "advanced foliage shader"?

    lars
     
  24. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25
    I use the AFS Tree Creator Leafs/Bark Optimized IBL shaders
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    if you want to use the "AFS Tree Creator Leafs/Bark Optimized IBL shaders" then you must NOT use the foliage tool.
    this is only needed if you want to convert a tree created using the built in tree creator to make it fit the needs of the "afs simple tree" shader.

    lars
     
  26. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25
    Thank's for your reply, a stupid user misunderstanding of the different use of the shaders ;)
    Slowly i understand...

    jochen
     
    Last edited: Jul 26, 2014
  27. -Singularity-

    -Singularity-

    Joined:
    Jul 27, 2014
    Posts:
    122
    Hi All,

    Hopefully someone can assist. After importing the full package I placed a few demo assets in my scene (pine with afs, banana plant, fern)

    Although they were shaded correctly at first, they now appear black...

    Is this a common error?

    Thanks in advance.
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    that is not the way it should be...
    please make sure that you add the "setup advanced foliage shader" script to your scene and configure it according to the documentation.

    lars
     
  29. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
    Hi lars, your shaders looks nice, but i have some problems with marmoset skyshop,i have black grass texture if i put a 2d grass texture on terrain, but if i use a prefab its looks normal.Without marmoset everything is fine.
     
  30. -Singularity-

    -Singularity-

    Joined:
    Jul 27, 2014
    Posts:
    122
    You are a gentleman - it seems I'd deleted it somehow

    another 5 stars for you
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    afs does not ship with a shader that supports placing grass as texture onto the terrain.
    so if you do so unity will use the built in shader (or the marmoset grass shader).
    as marmoset turns down the ambient lighting your grass might become black.

    solution: do not place grass as texture! do not do so because it would corrupt your texture atlas you have to create to make foliage placed within the terrain engine to work correctly.

    lars
     
  32. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25
    Hi Lars,
    i have managed it to optimize my trees with the simpleTerrainTreeIBL shader :). But when i use these trees with skyshop something strange happens. I setup the scene with the "setup advanced foliage shader" script, save the scene and after restart and load the scene the trees are black. Also it seems that the skyshop lightning don´t affect the trees. When i change for example the master intensity nothing happens on the trees.

    When i enable IBL lightning my prefabs turn black...

    Tia, Jochen
     
    Last edited: Jul 28, 2014
  33. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
    Thanks for reply lars.
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    - make sure that "Enable IBL" is checked in the "setup advanced foliage shader" script.
    - if the "setup advanced foliage shader" script does not control IBL ("Let AFS control IBL" is unchecked) it is up to skyshop to pass the cubemaps as global textures to all shaders.
    - anyway: skyshop > 1.06 has changed a lot of parameters. so you should always check "Let AFS control IBL".

    see above: please check always check "Let AFS control IBL" and make the settings fit those of skyshop.

    lars
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,

    version 3.02 is available – replacing the bug fix for version 3.01 and bringing all kind of fog modes to afs.

    lars
     
  36. broesby

    broesby

    Joined:
    Oct 14, 2012
    Posts:
    118
    Hi Lars,..

    Nice one ;-) Seems to me the new version has a solution which almost resembles yours. "Only objects in adjacent cells etc" ... The part about combining tree colliders to one big collider is really interesting also...

    FOG!!! Sounds nice. But is it only for Unity Pro?

    Thx, Jesper
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    that was a quote from the rust blog and has nothing to do with AFS, sorry.
    AFS does not do any fancy culling or streaming except from distance based layer culling.

    fog? fog is available in all version of unity…
    (but only fog mode = exp2 has been supported in former versions of AFS 3)
    lars
     
    Last edited: Jul 29, 2014
  38. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    Hi Lars,

    I fear I may not be using AFS to it's fullest potential because I have regular ol' flat grass and tree creator trees (Primarily from Nature Pack 2 (https://www.assetstore.unity3d.com/en/#!/content/1021). But I seem to be having a problem with wind on the grass...

    I using AFS at the same time I use TerrainComposer. I made sure the wind was at full speed on both and while my trees were almost shredded apart, the grass was quite happily sitting straight up. I am sure I did something wrong with AFS because my grass was waving fine before I added AFS. Any ideas what might be up?

    Thanks so much!
    -Mark
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi kivak,
    using nature pack 2 along with afs is absolutely ok, as far as i can say.
    (it comes with some smaller bushes modeled as tree which could easily converted into a "simple tree" in order to save draw calls and speed up rendering).

    as far as grass is concerned: afs only supports grass added as detail mesh (no simple textures, sorry).
    so the most simple mesh you could generate would be just a quad incl. vertex colors (alpha = 0 -> no bending, alpha = 1 -> full bending).
    when adding grass to the terrain using the afs grass shader for terrain (and it will be used by default as it overwrites the built in one) grass will bend to wind NOT according to the wind settings in the terrain inspector but according to the settings in the "setup advanced foliage shader" script.
    those are the 2 reasons i can think of that might cause your problem:
    - check the vertex color of your grass mesh
    - check the wind settings in the "setup advanced foliage shader" script.

    btw. grass will only be animated in playmode. enabling "animated materials" in the scene view does not work.

    i hope this helps,

    lars
     
  40. broesby

    broesby

    Joined:
    Oct 14, 2012
    Posts:
    118
    No, not AFS, I know. But you made a suggestion with a quad tree based array and pooling of the colliders. I was only acknowledging your wisdom as it seems that that idea resembles the Rust solution somewhat ;-D

    Btw, I asked in Pool Manager forum. Colliders themselves cannot for now be pooled per se. Only gameobjects can. But I suppose empty gameobjects with colliders is a workaround.

    About the fog: Sry ;-) I was thinking about something like the Global Fog image effect in Unity Pro. Because I do not yet own Unity Pro I always get excited whenever I think there is some elegant workaround for Unity Free on some effect that I'd like to play with - one of those is localised fog.

    Sry for confusion and thx for all your work.
     
  41. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140

    Hi Lars!

    Thanks so much for getting back to me. I thought that simple grass wasn't supported - it's a bummer! I am so new to this I don't even know how to make a texture grass into a mesh grass. I'll have to look into it...

    Regarding the wind... Is there a way to keep Unity's grass shader for the texture grass and the tree billboard shader from AFS? I really like the billboard trees and trees shading, but I fear I won't be able to find suitable grass models easily. Is that possible or do I have to use them as a package deal?

    Thanks!
    -Mark
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi mark,

    i do not recommend to add grass as textures to the terrain – simply because this would not let you use the "advanced foliage shader for the terrain engine."

    using the "advanced foliage shader for the terrain engine" needs all textures to be combined into one giant texture atlas manually. so all plants added to the terrain – no matter if they use the grass shader or the vertex lit one – have to have the same texture. in fact they even can/should share the same material: the terrain engine will pick up the correct shader according to your choice of "Render Mode" --> "Grass" or "Vertex Lit".
    the reason for this requirement: as the terrain engine itself will only pass one single diffuse texture for each material we have to add a second texture manually which contains all normal, roughness and translucency values.
    in order to get the correct values from this second map we have to know the uv layout. so we can’t let the terrain engine create the texture atlas but have to do it ourself.

    adding a grass texture will force the terrain engine to create a new texture atlas as it assumes that the grass texture is not part of the already assigned one. this will break the uvs and rendering of any plant using the "advanced foliage shader for the terrain engine" which replaces the built in "Vertex Lit" shader.

    if you do not want to use the "advanced foliage shader for the terrain engine" – well, then you could just add "grass as texture" to the terrain. unless you have checked "Billboard" even grass added as texture will be rendered using the "AfsWavingGrassTerrainEngine v3" shader as it overwrites the built in one (billboarded grass is rendered using the built in one). the "AfsWavingGrassTerrainEngine v3" shader supports image based ambient lighting and nicer wind animations – however it requires that you control wind using the "Setup advanced foliage shader" script.

    adding grass as mesh – even if it is just a simple quad – is always better than adding it as texture as it allows you to control its pivot:
    grass added as texture has its pivot always at the very bottom so grass might start to float when added to slopes.
    but if you add it as mesh you might raise the pivot of your mesh just a little bit which will make the grass sink into the terrain.
    other reasons are:
    - better control over fill rate due to tightly modeled meshes (pretty important as grass usually covers a lot of screen space)
    - easier to get rid of texturing artifacts (small borders around the grass) caused by texture filtering

    creating a simple grass mesh
    go to your 3d app and create a single upright oriented quad.
    move its pivot down so that it is just above the lower border.
    add vertex colors to it and set vertex color red, green and blue to 1.
    select the lower vertices and set vertex color alpha to 0 (no bending).
    select the upper vertices and set vertex color alpha to 1 (full bending).
    select the uvs and make them fit with the position of the desired texture in your texture atlas.
    done.

    lars
     
  43. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    Hi Lars,

    Thanks again for so much detail in your responses!! I definitely think creating some grass meshes would be the best way to go. It sounds so simple but I am finding it so difficult! (Note that I am not a 3D modeler in the least!). I found two free 3D modeling programs - Blender and Wings3D. However, I don't have the option to have alpha in vertex color in their of those programs... What software would you use to create this? I keep seeing 3DS but it's an insane amount of money to spend on grass. XD

    Thanks again for your help! I feel like if I could just find or make a simple mesh I could just change the textures and such in Unity and not have to worry about it.
    -Mark
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi mark,

    personally i use modo. and do not know much about blender.
    so if blender does not support editing vertex color alpha i see 3 ways to set up vertex color alpha:

    1. using blender, fbx, text editor
    add vertex colors to your mesh in blender (just pure white = rgb = 1,1,1).
    export it as fbx.
    fbx is a "text" based format so you can edit the fbx file using a text editor.
    (as a singel quad is a pretty simple model one might read "the" file)
    search for "color" or "colors" and you will find a block like this:

    LayerElementColor: 1 {
    Version: 101
    Name: "Color"
    MappingInformationType: "ByPolygonVertex"
    ReferenceInformationType: "IndexToDirect"
    Colors: 1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0
    ColorIndex: 0,1,2,3
    }

    the line "colors" contains 16 numbers: 4 vertices x 4 color values (rgba)
    if blender does not support rgba you will probably just get 12 values (4 vertices x 3 color values rgb)
    now you could either edit or add the fourth component of each vertex color (alpha).
    it is a bit guessing which color belongs to which vertex but it is only 4...
    finally save the fbx file and get it into unity.

    2. getting a free vertex color tool for unity
    e.g. this one: https://www.assetstore.unity3d.com/en/#!/content/2463
    and modify the vertex colors of your mesh right inside unity

    3. hack the afs foliage tool
    right now if you chose "set bending" it will modify vertex color blue as this is needed by the foliage shaders. so you might edit the AdjustBending() function and replace "colors.b" by "colors.a" within this function.

    method 1 would give you the possibility to open the fbx in blender again (and i hope it will keep vertex color alpha on exporting – otherwise just edit it again (copy & paste)). whereas method 2 + 3 would probably allow you to edit even more complex meshes.

    lars
     
  45. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    Hey lars, been a while.

    Any idea what is causing this? I have tried no roughness and full roughness, basically experimented with all sorts of setups on the normal with the roughness, normal strength, etc... for the life of me I can't figure out why that really shiny glossy side is showing up. Driving me crazy now.
     

    Attached Files:

  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    if your roughness map is set to black you should not get any specular reflection.
    which shader do you use? which texture did you modify?

    lars
     
  47. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    I am using the Advanced Foliage Shader IBL. I modified the Normal Map (r -> a, trans -> r, g is g, rough -> b). Set the normal map to regular normal map, also set it to advanced normal map, advanced default bypass srgb. Tried all kinds of stuff. I gotta be missing something really stupid and obvious.
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi wolfen,

    then it is probably the ambient specular reflection.
    please set your directional light to 0 and look if the reflection still exists.
    alternatively you can also set the "master intensity" to 0 (in the IBL settings of the setup script) and look if this solves the problem.
    it might be that you get problems here due to a simplified ambient spec term.

    lars
     
  49. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    Yeah, setting the sun to 0 removes it. Master intensity did nothing though. So whats the solution here? The lighting is about where we want it.
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hmm, i thought it would be caused by my simplified ambient specular reflection term – not the direct specular reflection which already is calculated pretty exactly.

    so right now i would say: that is physically based shading!
    if you have a look at your picture you will see that the viewing angle on the leaf plane you have marked is quite steep -> much refelection. even rough materials tend to fully reflect light (specular) instead of absorbing it (diffuse) towards grazing angles. lowering the specular color value will you get less specular reflections – however the amount of specular reflection at very steep angles will always be 1.
    find out more about that everything is shiny here:
    http://filmicgames.com/archives/547

    lars