Search Unity

[Released] Advanced Terrain Grass

Discussion in 'Assets and Asset Store' started by larsbertram1, Sep 11, 2017.

  1. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Im gomna buy this pack, A little marketing does a lot, I think the core package is looking very good, and if some people don't like it, there are other options.

    For me its sometimes better to have a package that does a few things very well instead of trying to do all. that said touch bending is cool, so would be cool if one day its part of it.
    Nice behavior of wind is also one the the things that i like, and it seem to have that already
     
    MaxiMuzz likes this.
  2. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    ATG has the flat-out most beautiful grass I've seen in Unity. For simple projects, it's a quick and easy swap-in. For bigger projects, it does take some time to optimize, as you'd expect. But mostly, I hope it becomes a standard (small "s") grass shader, with support for other tools like VS, so I can use it in all my projects.
     
    jdraper3 likes this.
  3. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Well, you've got my terrain on private thread. It was not possible to make it run faster than the default unity billboarded grass at the same density and distance. It did help with the cpu spikes (which I say it does really help) but performance wise it runs slower if you are using billboards. If i'm wrong, let me know, you have the terrain and all my textures. The only way I got it to run at about the same speed is by lowering density and other stuff, so it looked less quality than without it. At the end I had to decide between (unity) faster but cpu spikes or (atg) less density with almost no cpu spikes.
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i just opened the project as i had a slightly different recall.

    in fact atg gives me constant 530 – 570 fps (according to the stats window)
    cull distance: 220m, fade length: 70m, detail fade start: 20m, fade length: 30m, 8x8 buckets per cell, all 8 layers soft merged.
    CPU time: 1.8 – 2.2ms / GPU time: 2.6 – 3.6ms

    the built in grass gives me 230 – 720 fps – but stutters like hell.
    detail distance: 150m
    CPU time: 1.2 – 1.7ms (and 59.4ms spike!) / GPU time: 2.2 – 3.4ms

    so if you stand still built in grass is always faster.
    if you move, well then you have lost – or switch over to atg.

    but i have to admit, it is quite difficult to compare both solutions – visually: you set up your terrain, tweak the detail settings, set up dry and heathy colors to your liking and then atg forces you to merge all layers loosing the individual dry and healthy colors.
    so atg will make you tweak your textures and maybe even rework min and max size to get a visual pleasant result.
    and in case you used more complex geometry than just a single quad – let's say 4 single quads – you would be able to lower the density and the number of drawn instances dramatically – speeding up atg.

    so i guess you will have to give up the idea that there is a grass rendering solution which simply replaces the built in one, removes all caveats but gives you exact the same visual results.
    with atg i tried to make the transition as smooth as i could – most likely not smooth enough.

    personally i think a grass rendering solution which is rather fast when the camera is not moving but spikes like hell if it does is not valid candidate to make any comparisons against at all: it is just not usable at all.
     
  5. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    Sorry to hear that this hasn't been profitable - I think that adding support for other packages such as VS would definitely lead to sales.

    Also, I think that the visual quality of the shader (which is gorgeous!, btw) maybe wasn't emphasized enough. I personally think that is it's biggest selling point, even more so than the potential performance increases. The specular highlights and translucency, not to mention the custom wind, bring the quality light years ahead of any other grass shader out there for Unity.

    Fantastic work :)
     
  6. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    that thread is from 2014
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    this will most likely come with version 1.07 (1.06 is currently in the pipe).

     
    wetcircuit, jdraper3, osss and 5 others like this.
  8. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    what's the advantage of mixing it with vegetation studio?
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it is for people who prefer to let vs draw the grass – but want the advanced shading and bending functions from atg.
     
    trilobyteme and Hikiko66 like this.
  10. MaxiMuzz

    MaxiMuzz

    Joined:
    Dec 11, 2017
    Posts:
    3
    Can any body recommend how to put everything together?
    I like VS vegetation planting system but of course I prefer AFS or ATG for shading.
    Is anybody in the same situation and can recommend a way to do that?
    Honestly, I don't understand how these 2 assets work together ideally.
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you can either use vs just for the trees, rocks etc and let atg do the grass.
    or you can wait for the 1.07 release of atg which will bring shaders that can be used in vs: you just set up your material and assign one of the atg shaders, then add the prefab to vs and setup the atg wind component, done.
     
    MaxiMuzz, jdraper3 and gecko like this.
  12. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    well my heart would be split this way. I want bending, which is not supported on atg grass so I would need to move to vs. But I prefer the way atg draws the grass but it doesn't support bending.
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you mean touch bending i guess.
    for now i do not make any promises. but maybe the upcoming support for vs by atg will change the attention a bit so adding touch bending to atg directly will become more attractive to me :)
    right now i would just ignore touch bending – and check vegetation studio vs. atg as far as performance and workflow are concerned: these are the really important concerns for your project i think.
    and as i mentioned earlier: touch bending is a totally independent system. so atg for vs will support vs' touch bending system which is nice, but not what i have in mind.
     
    MaxiMuzz and jdraper3 like this.
  14. MaxiMuzz

    MaxiMuzz

    Joined:
    Dec 11, 2017
    Posts:
    3
    This would mean that I wouldn't profit from ATG's speed, I would just use ATG's shaders, right?
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    exactly. speed, memory usage and all the rest will be determined by vegetation studio.
     
  16. MaxiMuzz

    MaxiMuzz

    Joined:
    Dec 11, 2017
    Posts:
    3
    Do you think there's any "proper" way to combine the vegetation created in VS and ATG?
    Or is the vegetation created in VS created in such a way that it isn't accessible by your GrassManager so that ATG can't take control of the super-fast rendering?
     
    jdraper3 likes this.
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    version 1.07 is waiting for approval.
     
    jdraper3 likes this.
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    well, vs offers a pretty fast rendering as well. not as fast as atg if i have done my comparisons properly but still quite fast.
    but actually there is no way to get the data out of vs – especially if you use all it procedural features: all these are unique to vs.
     
    OfficialHermie and MaxiMuzz like this.
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    Version 1.07 and VegetationStudio support now is available.
     
  20. acaroppos

    acaroppos

    Joined:
    Jul 16, 2015
    Posts:
    31
    Is there a video that shows how to use ATG with VS, or is it written in the documentation of ATG?
    Or where should I look for a tutorial (if there's one)?
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you will find a chapter in the documentation:
    https://docs.google.com/document/d/...c1G9FGzUhdW1xWoyA/edit#heading=h.w2cgapxgjwpm
    basically all you have to do is to add the atg wind prefab to your scene, then take e.g. the atg grass prefab which comes with the package, set its material to use the VS_Grass_InstancedIndirect shader and add it to VS.
     
    Hikiko66 likes this.
  22. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    will baked lightmap support come later?
     
  23. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    Hi,are you still planning adding your own touch bending solution to this grass plugin?

    After some struggle with your shader,i found that it's impossible for me to do this with my poor shader skills.

    you are really a shader monster.

    I see you have added support for vegation studio that has touch bending function but will you add your own touch bending solution for some people who want to stick with native terrain system?
     
    Lars-Steenhoff likes this.
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    this is a feature that is not supported by unity right now: drawing a mesh using instancedindirect currently does not allow us to use lightmaps or gi. unfortunately we can not even steal these textures from the terrain as there is simply no scripting api to do so. so unity will have to come up with a solution – which at least is announced for 2018.
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    now that 2018 has been announced including the hd scriptable render loop things look a bit different and everything is on hold, sorry. as far as i have been told by the asset store team a lot of things will change during the next weeks especially as far as shaders are concerned.
    so i guess that i will focus my work on getting things work in unity 2018 first and any new feature will come later.
    that being said i do not promise that touch bending will come – as it is fully decoupled from what atg actually does and just a nice to have add on.personally i think other things are more important right now like the srl or making it all render even faster as this what atg basically is about.
     
  26. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
  27. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    finally,i got my touch bending system worked with atg.

    The main idea is to use a top-down camera render a touch objects layer into a rendertexture.
    use the vertex world position (x & z) as uv and sample the rendertexture in vertex shader.

    It is super fast,i've tested with over 100+ objects in same place with no performace problem,unlese you use a too big rendertexture.one 256*256 tex are already good enough to affect a 100m*100m area.
    And i tested it on multiple terrain in same game scene(5 terrains each is 5km*5km and all different),it works.
    can do touch bending,cuting down,burning.
    can be any shape.
    it dosen't care how big your terrain is.

    only two limits.
    1.it works in small area like 200m*200m or smaller,but i think this is not a real problem as you have the grass rendering distance and you can move the bending area with no problem.
    2.you need detect the player are really touching the grass or just in the sky then control the alpha channel of the bender mark make it rendering or not.

    here is some main code if someone interested with this system.
    sorry i cant post the whole grass shader because it belongs to larsbertram1 so i only post some code that will inspire you.

    hope larsbertram1 could make a official touch bending solution in atg soon.

    c# code:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class touchbend : MonoBehaviour {
    6.     public RenderTexture rtx;
    7.     public Camera camera;
    8.  
    9.     void Update () {
    10.         rtx.SetGlobalShaderProperty("_touchrtx");
    11.         Shader.SetGlobalFloat("_camposx",camera.transform.position.x);
    12.         Shader.SetGlobalFloat("_camposz",camera.transform.position.z);
    13.         Shader.SetGlobalFloat("_camsize",camera.orthographicSize);
    14.     }
    15. }
    16.  
    only need changed the vertex shader in "GrassInstancedIndirect_Vertex.cginc" if you are using "Grass_InstancedIndirect_Base.shader".

    float _camposx,_camposz,_camsize;
    sampler2D _touchrtx;

    //sample the rendertexture in world position,do some math make it move to the camera's real position and with same scale.
    float touch = tex2Dlod(_touchrtx,float4((wPos.x-_camposx+_camsize)*(1/(_camsize*2)),(wPos.z-_camposz+_camsize)*(1/(_camsize*2)),0,0)).r;

    //now you move down the grass in world y postion to do cuting down or touch bending.
    v.vertex.y -=touch*2*mainBending;

    //make the touch area turn into dark!
    color-=touch*3;


    touch.jpg
     
    Last edited: Dec 26, 2017
    rostik1975, eaque, one_one and 4 others like this.
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    is taht an official page? looks a little bit odd – and i could not find any official download...
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    great!
    i am really grateful that the forum once more shows its real potential which is sharing ideas and may be pushing things further in a wide spread collaboration. so thanks a lot for sharing.

    your basic concept (using a top down projected displacement texture) pretty much fits with what i have been thinking about.
    i assume that you use a 2nd camera to render the displacement texture?
    unfortunately having a 2nd camera already is "quite" expensive in unity – even if it just sees one single layer and a few objects: the costs for culling always are pretty high...
    so in case you only render out some simple geometry like on your screenshoots you may get away way faster by not using an additional camera but blitting the geo into the render texture using draw mesh or draw mesh now or something similar including instancing.

    but i would add a) direction and b) time to the displacement texture as well (not only force) to give you a more lively result which may even contribute to the gameplay.
    direction is quite easy in case you assume a radial obstacle – whereas time would need you to write you own system or rely on unity's built in particle systems and trail renderers – both needing a 2nd camera :(

    just for performance: in the vertex shader i would do a test against the bounds of the area currently occupied by the render texture before i sample it:
    if (worldpos.x > lowerbounds.xmin && worldpos.x < lowerbounds.xmax && worldpos.z > lowerbounds.zmin && worldpos.z < lowerbounds.zmax) {
    sample rt and do all the rest...
    }
    in case you have encoded directionality into the rt you can add the touch bending force on top of the wind force. this way you should get nicer bending.

    anyway: keep up your great work and us posted!
     
    Last edited: Dec 29, 2017
    eaque and jdraper3 like this.
  30. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    #60 <<<< link


    It's the beta for the new input system, it's based on 2018.1 and if an official unity release. It jus not the unity 20181 beta that unity will release next year. It does have tessellation for metal and a bunch of other features.
     
  31. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    wow,you just solved another bug of my system by a simple test which i will do more stupid way to fix!
    it happens when the bender are half in the rendertexture half out.

    halfout.jpg

    I'm trying to use another mask texture to fix it,how stupid i am!:eek:
    And you have improved the performance too!
    Thanks a lot!

    about adding direction and time in the rendertexture,i have some concept but haven't test it.
    Maybe they are stupid too,but i think it's always good to share.

    as you said,a radial obstacle,stores direction in red and green channel like this.
    red = direction x
    green = direction z

    direction.jpg

    bending makrers with these information could make grass bend to direction we want.
    we can render some blue colored marker for burning area to make some grass turned into dark.
    both of them should have no affect to alpha channel.
    in the alpha channel we could render some black color but white alpha markers as grass cuting down area.
    we could use some special shader mostly like particle shader "additive" to render them for keep all information when they overlapped.
    they should be looked like this(please act you can not see "cut down" in rgb channel only can see it in alpha channel.)

    QB98~48KC{Y~D9SDI(EBJ]U.png

    with all these above,we could use only one "2nd camera" to store most people needed information.

    using draw mesh could be fast in rendering, but i think it will be more costly to manager them.
    as you will have to check every marker should be rendered or not at every frame.
    think about checking 1000 markers 60 times per second in C# script.
    a limited count of dynamic markers could work but you will lose the possibility to make some special grass area.

    we could even move these bending markers far away from the characters and main camera to render them in the 2nd camera for not using culling system.

    just some thought.:)
     
    Last edited: Dec 29, 2017
    eaque and Lars-Steenhoff like this.
  32. AntonBertelsen

    AntonBertelsen

    Joined:
    Oct 13, 2014
    Posts:
    37
    Hi there. The system is really awesome, and I hope to see the touchbending system here maybe make its way into the official package, even though I realize that's not really what it's for. I tried to add a system similar to dongliang's, but I'm a bit of a shader noob, so I gave up in the end.

    My problem is this: The system runs fast, and the tiles generate at a reasonable phase. Great, however since they only seem to generate in front of the camera, it's a problem when the player has their camera pointed in the opposite direction that they are moving. If the player e.g. walks backwards, and then quickly turns around, the tiles behind the player won't have generated. This is easily reproducable with the demo scene you've included. I really hope that this can somehow be adressed :)
     
    Lars-Steenhoff likes this.
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    actually i have not been able to reproduce your problem although i raised the camera sensitivity to 270 in order to be able to rotate very quickly. nevertheless i believe that your problem actually exists. i just have not found a way to reproduce it...
    you may try to raise the cache distance. this will release cells which have been visible at a further distance so more cells will be kept in memory and do not have to be regenerated.
    you may also try to check "ignore visibility" so grass will always be generated and "rendered" in a cirvle around the player. in case you enable the debug stats the number of "visible cells" will explode – but you may just keep calm as unity will do a frustum check before it actually draws the the cells. so you just get a little bit more work on the cpu – not the gpu.
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    exactly!

    direction for a circle is solved. when it comes o quads or rectangles it gets a bit more complicated as you would have to rotate the direction from local to world space. i would use nicely tessellated meshes for this (at least around the corners) store the direction e.g. in the vertex colors, do the rotation in the vertex shader and send it to the pixel shader.
    time i guess needs trail renderers or particle systems.

    oh, i did not think of 1000 obstacles. although in case you use culling groups to get all obstacles in a radius of 100m this usually takes something like 0.01ms.
    but why should one need 1000 obstacles?
    static objects like rocks, houses, ... --> just delete the grass from the terrain.
    so only dynamic objects are left which i hardly believe that you will have more than 20 – 100 which are in the range interesting to touch bending. talking about enemies you will already have some kind of lod system which does the ai and simulation based on the distance to the camera – simply hook in here and let the highest lod also register to the touch bending manager. remove it from the manager when it switches to a lower lod.
     
  35. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    You inspired me to make some premade bending markers like these.

    cc.jpg


    render them only with their world normal as base color.
    color.r = normal.x
    color.g = normal.z
    color.b = 0

    actually i'm using "color.r = (normal.x+1)/2" to avoid the value bettwen -1 ~0.we will need do some math in vertex shader get the value back.it will be easy.

    then we can rotate these marker always with correct direction information for grass.

    this is a more "noob friendly" way for me,lol.



    aaa.jpg
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
  37. drlh1976

    drlh1976

    Joined:
    Oct 6, 2017
    Posts:
    20
    BUG report:
    1.When start in game mode ,the grass become red!
    2.Some grass have vertex position error and it's a very serious problem.
    I use unity 2017.1.0f3 in win7 X64. After create a new project named Grass and import the package and open scene '02 Full Demo', then run into GAME mode, the bugs appers.
     
    Last edited: Dec 31, 2017
  38. drlh1976

    drlh1976

    Joined:
    Oct 6, 2017
    Posts:
    20
  39. drlh1976

    drlh1976

    Joined:
    Oct 6, 2017
    Posts:
    20
    Sorry for the post in review section in the asset store, I will modify it as soon.
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    this most likely is caused by the fact that you use deferred rendering but have not assigned the atg deferred shaders (deferred lighting and reflections).
    from the docs:
    Please note: ATG offers advanced lighting features such as translucency and physically inspired specular reflections on grass. So in case your camera uses deferred rendering you have to assign the ATG deferred shaders in Edit -> Project Settings -> Graphics:
    Under the Built-in shader settings change Deferred to custom, then assign the ATG_Internal-DeferredShading shader.
    Also change Deferred Reflections to Custom and assign the ATG_Internal-DeferredReflections shader.

    it looks as if the weed model gets very strong wind. you may try to lower its wind strength (in the material) or sample wind at the pivot only or even use a different lod level to sample the wind texture.

    thank you!
     
  41. drlh1976

    drlh1976

    Joined:
    Oct 6, 2017
    Posts:
    20
    Still some bug maybe. Some kind of grass looks hight light in deferred mode:
    1.Hight light grass in deferred mode:
    deferred1.jpg

    2.And high light grass flicks in scene in deferred mode.
    deferred2.jpg


    3.Hight light grass
    deferred3.jpg

    4.Grass looks normal in Forward mode.
    forward.jpg
     
  42. drlh1976

    drlh1976

    Joined:
    Oct 6, 2017
    Posts:
    20
    "Some grass have vertex position error and it's a very serious problem" ---
    I don't use very strong wind. This happen just in the demo scene without any modification.
    I open the package in another pc, it looks fine.Why?
     
  43. drlh1976

    drlh1976

    Joined:
    Oct 6, 2017
    Posts:
    20
    Another problem, Grasses faraway flick serious when moving camera.Is there too many question?:)

    flick.jpg
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    that dry grass has no translucency mask – so it gets fully back lit and pretty bright.

    i do not know what you mean with "flick". but from what i can see on your screen shoots: grass uses alpha testing. so if it is far away it might be just some pixels which get rendered to screen. in case of the dry grass it is even worse as it has a very thin stem which most likely will not get rendered at all. you may consider using trilinear filtering on the grass texture though.

    i can not confirm this: it looks the same both in deferred and forward.

    i can only guess: driver problems. how does the configuration of the pc which shows the heavily distorted grass look like? which GPU, which operating system? which version of direct x?
     
  45. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    anyone can think of a way to set a windy force only on certain area? I want the grass behind a propeller/fan to shake when it's on. I can't think of a way to do this.
     
  46. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    In the docs it says that ATG does not distribute grass at Runtime, does this mean it would not work with Map Magic infinite terrain or does is still work if MM is the distributor of the grass an ATG just does the rendering?

    :confused:
     
  47. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    We've set up a quality manager for the Grass Manager, which changes the density and culling distance values at different quality levels. It works, but throws two errors (outofrange when selecting a lower levels, culling group when selecting higher levels). Any idea what we're doing wrong?

    Here's our code and the errors:

    grassManager.CullDistance = terrainSettings [3].grassCullDistance;
    grassManager.DetailDensity = terrainSettings [3].grassDensity;

    after that this is called;

    grassManager.RefreshGrassRenderingSettings(bunch of args)

    refresh takes all (most) of the grass manager settings as arguments which we just pull from the grass manager directly in the call.

    And the errors:


    IndexOutOfRangeException: Array index is out of range.
    AdvancedTerrainGrass.GrassManager.InitCellContent (Int32 layer, Int32 index, Int32 cellIndex, Boolean b_initCompleteCell) (at Assets/_AdvancedTerrainGrass/_Scripts/GrassManager.cs:1377)
    AdvancedTerrainGrass.GrassManager.BurstInit () (at Assets/_AdvancedTerrainGrass/_Scripts/GrassManager.cs:736)
    AdvancedTerrainGrass.GrassManager.RefreshGrassRenderingSettings (Single t_DetailDensity, Single t_CullDistance, Single t_FadeLength, Single t_CacheDistance, Single t_DetailFadeStart, Single t_DetailFadeLength, Single t_ShadowStart, Single t_ShadowFadeLength, Single t_ShadowStartFoliage, Single t_ShadowFadeLengthFoliage) (at Assets/_AdvancedTerrainGrass/_Scripts/GrassManager.cs:289)
    VONOptionsController.ToggleQuality (Int32 i) (at Assets/09 Scripts/GameSpecific/VoN/VONOptionsController.cs:115)
    UnityEngine.Events.InvokableCall`1[System.Int32].Invoke (Int32 args0) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:206)
    UnityEngine.Events.CachedInvokableCall`1[System.Int32].Invoke (System.Object[] args) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:344)
    UnityEngine.Events.UnityEvent`1[System.Boolean].Invoke (Boolean arg0) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent_1.cs:65)
    UnityEngine.UI.Toggle.Set (Boolean value, Boolean sendCallback) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Toggle.cs:190)
    UnityEngine.UI.Toggle.Set (Boolean value) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Toggle.cs:163)
    UnityEngine.UI.Toggle.set_isOn (Boolean value) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Toggle.cs:157)
    UnityEngine.UI.Toggle.InternalToggle () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Toggle.cs:223)
    UnityEngine.UI.Toggle.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Toggle.cs:234)
    UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:50)
    UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261)
    UnityEngine.EventSystems.EventSystem:Update()



    CullingGroup bounding distances must be sorted in ascending order.
    0 libsystem_c.dylib 0x00000000a1db11fb thread_stack_pcs + 11
    1 Unity 0x000000000053b132 backtrace + 18
    2 Unity 0x00000000017eb4c8 _Z13GetStacktracei + 104
    3 Unity 0x0000000000a5cf00 _Z17DebugStringToFileRK21DebugStringToFileData + 352
    4 Unity 0x0000000000a5ad11 _Z17DebugStringToFilePKciS0_i15LogMessageFlagsiiPFvRK11CppLogEntryE + 97
    5 Unity 0x000000000078fe4b _ZN12CullingGroup20SetBoundingDistancesEPKfm + 507
    6 [Mono JITed code] (wrapper managed-to-native) UnityEngine.CullingGroup:SetBoundingDistances (single[]) + 0xfa (0x1432ab1e0 0x1432ab309) [0x13e4ea330 - Unity Child Domain]
    7 [Mono JITed code] AdvancedTerrainGrass.GrassManager:RefreshGrassRenderingSettings (single,single,single,single,single,single,single,single,single,single) + 0x202 (0x14a3d21f0 0x14a3d2e24) [0x13e4ea330 - Unity Child Domain]
    8 [Mono JITed code] VONOptionsController:ToggleQuality (int) + 0x414 (0x168336760 0x168336bcb) [0x13e4ea330 - Unity Child Domain]
    9 [Mono JITed code] UnityEngine.Events.InvokableCall`1<int>:Invoke (int) + 0xc6 (0x168336670 0x16833675a) [0x13e4ea330 - Unity Child Domain]
    10 [Mono JITed code] UnityEngine.Events.CachedInvokableCall`1<int>:Invoke (object[]) + 0x82 (0x1683365b0 0x168336656) [0x13e4ea330 - Unity Child Domain]
    11 [Mono JITed code] UnityEngine.Events.UnityEvent`1<bool>:Invoke (bool) + 0x366 (0x168335b60 0x168335f8a) [0x13e4ea330 - Unity Child Domain]
    12 [Mono JITed code] UnityEngine.UI.Toggle:Set (bool,bool) + 0x3e7 (0x168335710 0x168335b30) [0x13e4ea330 - Unity Child Domain]
    13 [Mono JITed code] UnityEngine.UI.Toggle:Set (bool) + 0x84 (0x168335650 0x1683356f8) [0x13e4ea330 - Unity Child Domain]
    14 [Mono JITed code] UnityEngine.UI.Toggle:set_isOn (bool) + 0x7f (0x168335590 0x168335633) [0x13e4ea330 - Unity Child Domain]
    15 [Mono JITed code] UnityEngine.UI.Toggle:InternalToggle () + 0x150 (0x14dd029f0 0x14dd02b64) [0x13e4ea330 - Unity Child Domain]
    16 [Mono JITed code] UnityEngine.UI.Toggle:OnPointerClick (UnityEngine.EventSystems.PointerEventData) + 0xd7 (0x14dd028e0 0x14dd029db) [0x13e4ea330 - Unity Child Domain]
    17 [Mono JITed code] UnityEngine.EventSystems.ExecuteEvents:Execute (UnityEngine.EventSystems.IPointerClickHandler,UnityEngine.EventSystems.BaseEventData) + 0xbf (0x165e36310 0x165e363f3) [0x13e4ea330 - Unity Child Domain]
    18 [Mono JITed code] UnityEngine.EventSystems.ExecuteEvents:Execute<object> (UnityEngine.GameObject,UnityEngine.EventSystems.BaseEventData,UnityEngine.EventSystems.ExecuteEvents/EventFunction`1<object>) + 0x550 (0x165e337a0 0x165e33fba) [0x13e4ea330 - Unity Child Domain]
    19 [Mono JITed code] UnityEngine.EventSystems.StandaloneInputModule:processMousePress (UnityEngine.EventSystems.PointerInputModule/MouseButtonEventData) + 0x10cc (0x151053000 0x151054774) [0x13e4ea330 - Unity Child Domain]
    20 [Mono JITed code] UnityEngine.EventSystems.StandaloneInputModule:processMouseEvent (int) + 0x2b5 (0x146746d40 0x146747690) [0x13e4ea330 - Unity Child Domain]
    21 [Mono JITed code] UnityEngine.EventSystems.StandaloneInputModule:processMouseEvent () + 0x79 (0x146746c90 0x146746d2d) [0x13e4ea330 - Unity Child Domain]
    22 [Mono JITed code] UnityEngine.EventSystems.StandaloneInputModule:process () + 0x386 (0x146745ed0 0x14674627a) [0x13e4ea330 - Unity Child Domain]
    23 [Mono JITed code] UnityEngine.EventSystems.EventSystem:Update () + 0x6e5 (0x147e6ebe0 0x147e6f2e9) [0x13e4ea330 - Unity Child Domain]
    24 [Mono JITed code] (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) + 0xfa (0x1262d1450 0x1262d167d) [0x13e4ea330 - Unity Child Domain]
    25 libmono.0.dylib 0x000000003dce1036 mono_get_runtime_build_info + 3654
    26 libmono.0.dylib 0x000000003de0cc9e mono_runtime_invoke + 117
    27 Unity 0x0000000000ec89da _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 106
    28 Unity 0x0000000000e794a7 _ZN13MonoBehaviour21CallMethodIfAvailableEi + 455
    29 Unity 0x00000000008052cb _ZN20BaseBehaviourManager12CommonUpdateI16BehaviourManagerEEvv + 507
    30 Unity 0x000000000080508f _ZN16BehaviourManager6UpdateEv + 47
    31 Unity 0x0000000000ab5198 _ZZ23InitPlayerLoopCallbacksvEN41UpdateScriptRunBehaviourUpdateRegistrator7ForwardEv + 40
    32 Unity 0x0000000000ab58f3 _Z10PlayerLoopv + 963
    33 Unity 0x0000000001834a74 _ZN20PlayerLoopController11UpdateSceneEb + 564
    34 Unity 0x000000000183046c _ZN20PlayerLoopController19UpdateSceneIfNeededEv + 108
    35 Unity 0x000000000182f7a4 _ZN11Application9TickTimerEv + 3812
    36 Foundation 0x000000008e07ee0f __NSFireTimer + 83
    37 CoreFoundation 0x000000008c5f4c54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    38 CoreFoundation 0x000000008c5f48df __CFRunLoopDoTimer + 1071
    39 CoreFoundation 0x000000008c5f443a __CFRunLoopDoTimers + 298
    40 CoreFoundation 0x000000008c5ebb81 __CFRunLoopRun + 2065
    41 CoreFoundation 0x000000008c5eb114 CFRunLoopRunSpecific + 420
    42 HIToolbox 0x000000008bb4bebc RunCurrentEventLoopInMode + 240
    43 HIToolbox 0x000000008bb4bbf9 ReceiveNextEventCommon + 184
    44 HIToolbox 0x000000008bb4bb26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
    45 AppKit 0x000000008a0e4a54 _DPSNextEvent + 1120
    46 AppKit 0x000000008a8607ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
    47 AppKit 0x000000008a0d93db -[NSApplication run] + 926
    48 AppKit 0x000000008a0a3e0e NSApplicationMain + 1237
    49 Unity 0x000000000044be37 _Z10EditorMainiPPKc + 839
    50 Unity 0x000000000044c2b9 main + 9
    51 libdyld.dylib 0x00000000a1d74235 start + 1
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    have you had a look into the demo script that is provided with th epackage and included in the demo scene? (pressing "1" or "2" lets you switch between different settings in play mode).
    this is the error which got my first attraction. and it is pretty clear about what was wrong: the culling group expects 2 values: float[] distances = new float[] {t_CullDistance, t_CacheDistance}; where t_CullDistance must be smaller than t_CacheDistance.
    if you fix this error all others might already go.
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it means that map magic's infinite terrains are not supported: atg has to transfer unity's grass distribution and terrain's height map data into its own format – which is a quite time consuming process (we are talking about several seconds...) which either takes place at startup or in the editor (in case you "safe" the terrain data).
    as map magic however will have its own format for distribution and height i could think about a short cut and transfer the data directly from mm instead of reading it from the terrain engine.
    however this is nothing i am investigating actively right now as atg has been designed for artist authored sandboxed levels, sorry.
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you could use the same approach as chosen by @dongliang28: use an additional camera top down and let it render only a special layer where you just render a particle system or some geometry in order to create a render texture which contains additional forces. sample that rt in the vertex shader to add another force to the grass.