Search Unity

[Released] Advanced Terrain Grass

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

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it might be that you have forgotten to add the "Lux Setup" script to your scene... that is what you need to configure the lighting settings for skin, anisotropic and also translucent lighting. latter is what the grass and plants use.

    so in editor all shader params might have been set in another scene. but in case you export just a single scene which misses the script translucency scale e.g. will not be set -> 0.0
     
  2. Kaen_SG

    Kaen_SG

    Joined:
    Apr 7, 2017
    Posts:
    206
    I'm aware of the Lux, ATG and AFS setup scripts, but I thought that if the ATG shader is used... then only the ATG setup script is needed. However you are probably right, since Lux Plus is used as the overall "custom shader" maybe Lux script is now needed on every scene, will test this out!
     
  3. Kaen_SG

    Kaen_SG

    Joined:
    Apr 7, 2017
    Posts:
    206
    That was it! It worked....

    upload_2018-5-31_18-48-45.png

    Going to test with more ATG/AFS stuff now.... I hope the Lux setup script doesn't overwrite the settings from ATG/AFS :)
     
  4. Kaen_SG

    Kaen_SG

    Joined:
    Apr 7, 2017
    Posts:
    206
    AFS installs some parts of Lux Personal... are those needed at all? because they are throwing up errors on builds.

    Shader error in 'Hidden/Lux Personal Internal-DeferredShading': failed to open source file: 'Lux Deferred Library.cginc' at line 30 (on d3d11)

    Compiling Vertex program with SPOT SHADOWS_DEPTH
    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 UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
     
  5. PatrickLipo

    PatrickLipo

    Joined:
    Mar 14, 2015
    Posts:
    36
    Any update on 2018.1 support? Sorry, I'm just all stoked to use ATG!
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you can get rid of lux.
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it should come pretty soon.
     
    gecko likes this.
  8. larsbertram1

    larsbertram1

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

    version 1.08 has been just submitted — adding support for unity 2018.1 next to a bunch of other changes and improvements.
    it should hit the asset store within the next days.
     
    gecko and Kaen_SG like this.
  9. PatrickLipo

    PatrickLipo

    Joined:
    Mar 14, 2015
    Posts:
    36
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it is live – or should be within the next hour.
     
    Last edited: Jun 6, 2018
    gecko and PatrickLipo like this.
  11. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm finally setting up some grass for real. My project is in 2018.1.2, and I"ve downloaded the latest version of ATG. But at runtime, the grass is solid gray. I can't figure out what I'm doing wrong. (I had not set it up on 2017.x so I'm not positive it's a 2018 issue). Any guess what I'm doing wrong?

    gray grass.png
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you have assigned the grass array shader - but no texture array (2nd slot from the top).
     
  13. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Oh, I was using the Array shader because the Base shader wasn't displayed in the pulldown....now I've reimported ATG again and it does show up, and using that works. Weird....but thanks, all good now!
     
  14. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Now I'm setting it up in a multi-tile terrain. So far it looks like it works without any special config. Is that the case? I thought I read somewhere that you have to save TerrainData on each terrain tile, but I can't find that now....is that useful or necessary? Any other tips?
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    baking the terrain data speeds up the start up. but i only recommend to use it if you are finished with your terrain as you might just tweak your settings and will have to rebake the data afterwards. so it is prone to produce weird results if you forget to rebake it.
    in case you stream in your terrains it is mandatory as otherwise you would get a huge spike if a new terrain awakes.
     
    gecko likes this.
  16. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm getting some large brightness variations for two grass meshes that use the same material/shader (Grass Base). Generally it seems that the taller grass is darker than the shorter grass, but as I tweak the size of each one, the degree of difference varies quite a bit (sometimes a pleasing moderate difference, sometimes way too much difference, with the taller grass being way too dark). Any idea what's going on with that and how to control it more?

    Also: Is there a way to lock the Min/Max Size values on each prototype in Grass Manager? They're overridden by the grass sizes in the terrain, but unreliably and I'd much rather set and lock those in the Grass Manager. Possible?

    thx!
    Dave
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    actually color variation is derived from scale and lerps between dry and healthy color.
     
  18. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Ah, I see, thanks.

    So IS there a way to lock the Min/Max sizes on the prototypes in Grass Manager? My problem is that I'm using Terrain Composer 2 to plant the grass. Instead of Min/Max width and height, it has Random Width and Height values....and those are interpreted oddly by the terrain engine, so the Min width/height is always larger than than the Max width/height, which leads to screwy results of course. And since the TC2 dev doesn't respond to pleas for help anymore, I'm hoping that I can control these values in ATG instead. Is that possible?

    thx
    Dave
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you would have to edit the script.
     
  20. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Okay....can you give me any tips on how to do that?
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hmm, the easiest way would be to just not hit "Get Prototypes" :)
    this will call the function "void GetPrototypes()" in the "GrassManagerEditor.cs".
    lines 559 - 560 sync the min and max sizes:
    MinSize.GetArrayElementAtIndex(i).floatValue = terData.detailPrototypes.minHeight;
    MaxSize.GetArrayElementAtIndex(i).floatValue = terData.detailPrototypes.maxHeight;

    so you may wrap this with an: if (MinSize.GetArrayElementAtIndex(i).floatValue != null) {} in order to avoid already existing values from being overwritten by values from the terrain engine.
    it is a bit tricky as the grass manager currently does not handle deleted or new layers in a comfortable way.
     
  22. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Grass Manager populates itself with grass/detail objects from the terrain even if I don't click Get Prototypes. And if I make any changes to the terrain grass/detail settings, Grass Manager sometimes updates itself. Looking closer, that seems to happen at runtime -- especially after I toggle Grass Manager off/on (to apply changes to density or whatever). Then switches back to the previous value after I stop. So that's certainly frustrating. I'm using ATG 1.08 in Unity 2018.1.2 on Mac High Sierra.

    EDIT: In fact, simply clicking on any terrain in the scene changes the colors on the grass material to whatever is set in the terrain object popup.

    I added your if code but that doesn't help the issue above -- here it is just in case I did it wrong:


    if (MinSize.GetArrayElementAtIndex(i).floatValue != null) {
    MinSize.GetArrayElementAtIndex(i).floatValue = terData.detailPrototypes.minHeight;
    MaxSize.GetArrayElementAtIndex(i).floatValue = terData.detailPrototypes.maxHeight;
    }
     
    Last edited: Jun 13, 2018
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    sorry, i missed the min- and maxsize adjustments in the OnInspectorGUI function (line 351, 357, 445 and 452).
    color adjustments start at line 648.
     
  24. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Could I trouble you to make these edits to the script and send it to me? I'm not a coder and I just create errors when I try to add this wrapper in all those places. Or (ideally) there's be a toggle somewhere which prevents Grass Manager from updating the color and size values at runtime/reinstantiate (which sounds like the intended behavior anyways, but isn't how it actually works).

    thx
    Dave
     
  25. FuzzyShan

    FuzzyShan

    Joined:
    Jul 30, 2012
    Posts:
    182
    This looks amazing, I was wondering what's the difference between this and vegetation studio? Can these two system been used parallel with eachother?
     
  26. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks again for your help with my issues above (resolved via PM; if anyone is curious: mostly I'd forgotten about the SwitchGrass script for refreshing the prototypes, but Lars also added a handy toggle to lock the prototypes.)

    [EDIT: Solved that problem]

    EDIT: Another question: We've got a MainCamera in the scene, but sometimes switch to an alternate camera with some special settings. The former is third-person, the latter is first-person. I've set the Cameras pulldown to All Cameras, and the grass renders in both -- but the grass doesn't update when the latter camera is active, so if I move around, I come to the edge of the rendered grass. If I switch back to the MainCamera, ATG updates the grass and I'm surrounded by it again. How can I make the alternate camera do that too?

    EDIT: Having a weird issue with the grass tints, happens consistently in every scene: I tweak the material healthy and dry colors, but at runtime they are often too pale -- but then I click on the Prototype buttons on the GrassManager, and they change to my desired color. Or sometimes too dark...well, I guess I don't really know what they're switching to/from, but the problem is that the tint is unreliable. Any idea what's going on there or how to fix it? I can make a video if you like, but it's basically just as described.


    thanks
    Dave
     

    Attached Files:

    Last edited: Jun 25, 2018
  27. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    So now I'm trying to use the SwitchGrassSettings script to regenerate the grass, but I'm getting unexpected results: I have my Cull Distance set to 110, and my understanding is that pressing 1 would simply regenerate the grass at the current settings -- but the cull distance is definitely shorter when I do that. When I press 2, the grass is not only denser (which I expected), but the cull distance is much longer as well. And yet the actual values on GrassManager don't change at all. I've looked at the script, and though I'm not a coder, it looks like pressing 1 shouldn't change any of those values, but it definitely does. It's even more obvious if I set my cull distance to 33 -- then both 1 and 2 dramatically change the cull distance. I'd be grateful for any help (and also on the above issues).

    thanks!
     
  28. BlandonDu

    BlandonDu

    Joined:
    Dec 26, 2016
    Posts:
    10
    Hi Lars, I bought your great stuff 2 days ago, and been going through this system to make it suitable for my project. It is now looking good, but only one thing get me stuck.

    http://www.squatnine.com/screenshot_23/
    (uploaded picture does not show,check the linked image)

    The terrains in my project are tiled into 4 pieces,and they are mirror of each other.When charactor moves, these terrains scrolls with it "step by step"( 1,1mirror,1,mirror ) in order to loop infinitely.

    So my question is when the terrains moves, the ATG grass does not follow, and as you description of "no runtime distribution..." and also the initialization process seems very slow, that might kills the posibility to refresh ATG on the fly. But since I only have 4 terrains "static" , when scrolling these terrains, the data remains the same, I just need a way to ask ATG to apply some sort of offset upon the shifted terrain coodinate.

    How do I do it? If your suggestion is something about shader modification, could you give me few lines of example? since i am not very farmilar with shader code, that might be toomuch to ask, few tips would be appreciated for sure.

    Thanks!
     
    Last edited: Jun 30, 2018
  29. BlandonDu

    BlandonDu

    Joined:
    Dec 26, 2016
    Posts:
    10
    Keyword: Moving terrain, dynamic terrain, runtime (incase one like me can not find this similar concern)

    It seems that our gardener is pretty busy,and also I kind of found a temporary solution of Moving terrains.

    //----------------------------------------
    my case is rather special, there are only 4 terrain pieces in total and also no terrain would need to instantiate on the fly, that means the grassManager(s) are able to grab all information that they need and do the init() (or fastInit()) job at the beginning . so every time when the terrains move. then do something like this.
    Code (CSharp):
    1.  
    2.         public void updateTerrainPosition()
    3.         {
    4.             TerrainPosition = ter.GetPosition();
    5.  
    6.             Vector3 Center;
    7.             GrassCell CurrentCell;
    8.             for (int x = 0; x < NumberOfCells; x++)
    9.             {
    10.                 for (int z = 0; z < NumberOfCells; z++)
    11.                 {
    12.                     var CurrrentCellIndex = x * NumberOfCells + z;
    13.                     CurrentCell = Cells[CurrrentCellIndex];
    14.  
    15.                     Center = CurrentCell.Center;
    16.  
    17.                     Vector2 normalizedPos;
    18.                     normalizedPos.x = (x * CellSize + 0.5f * CellSize) * OneOverTerrainSize.x;
    19.                     normalizedPos.y = (z * CellSize + 0.5f * CellSize) * OneOverTerrainSize.z;
    20.                     float sampledHeight = terData.GetInterpolatedHeight(normalizedPos.x, normalizedPos.y);
    21.  
    22.  
    23.                     //  Center in World Space – used by cullingspheres
    24.                     Center.x = x * CellSize + 0.5f * CellSize + TerrainPosition.x;
    25.                     Center.y = sampledHeight + TerrainPosition.y;
    26.                     Center.z = z * CellSize + 0.5f * CellSize + TerrainPosition.z;
    27.  
    28.                     CurrentCell.Center = Center;
    29.  
    30.                     var NumberOfLayersInCell = CurrentCell.CellContentCount;
    31.                     for (int j = 0; j < NumberOfLayersInCell; j++)
    32.                     {
    33.                         var CurrentCellContent = CellContent[CurrentCell.CellContentIndexes[j]];
    34.  
    35.                         CurrentCellContent.Center = Center;
    36.                     }
    37.                 }
    38.             }
    39.             boundingSpheres = new BoundingSphere[TotalCellCount];
    40.             //isVisibleBoundingSpheres = new bool[TotalCellCount];
    41.  
    42.             var side = (CellSize * 0.75f) * (CellSize * 0.75f);
    43.             var CullingRadius = Mathf.Sqrt(side * 2.0f);
    44.  
    45.             for (int i = 0; i < TotalCellCount; i++)
    46.             {
    47.                 boundingSpheres[i] = new BoundingSphere(Cells[i].Center, CullingRadius);
    48.                 //isVisibleBoundingSpheres[i] = false;
    49.             }
    50.             cullingGroup.SetBoundingSpheres(boundingSpheres);
    51.         }
    52.  
    53.  
    also in the GrassCellContent.cs , I inserted some code in a new setter(which is used to be a public variable only)

    Code (CSharp):
    1. bool initialised = false;
    2.         // center in world space
    3.         private Vector3 center;
    4.         public Vector3 Center
    5.         {
    6.             get
    7.             {
    8.                 return center;
    9.             }
    10.             set
    11.             {
    12.                 center = value;
    13.                 if(initialised)
    14.                 {
    15.                     //InitCellContent_Delegated();
    16.                     //update the bounds
    17.                     bounds.center = Center;
    18.                     var Extent = (Center.x - Pivot.x) * 2.0f;
    19.                     bounds.extents = new Vector3(Extent, Extent, Extent);
    20.                     // I think the above code might be not nessasary,but since its cheap.
    21.  
    22.                     state = 0;//maybe 2? I am not 100% sure, but 0 garranties it will be re-initialised
    23.                 }
    24.                 else
    25.                 {
    26.                     initialised = true;
    27.                 }
    28.             }
    29.         }
    So these modification solved my problem. but I am pretty sure the cached cells still remain being out of date,but because my terrains are much larger than the size all living cells combined, so all these buffers will be replaced by new refreshed ones long before the camera move to the next terrain which was just transported. so I do not have to rebuild the cache, which is good and also important(rebuilding cache might causes cells flickering, I assume) .

    So , if your case need to constantly moving the terrain (other than switching between, like my case), you might consider other solution .
    If you have massive sized terrain which is conposed with small pieces , you might need to do something like prebuilding the grass data and save to local corresponds to the terrain data accordingly by some sort of mapping.However, I think this would be even awesome to be supported natively by ATG in the feature somepoint
     
  30. Zaki_X

    Zaki_X

    Joined:
    Jul 5, 2016
    Posts:
    55
    Hi Lars,
    I've updated ATG today and all my Fern's prefabs from your package are gone. I've tried putting this Fern into my scene, but the only thing that I see is it's shadow. All worked fine yesterday after this update. I'm using Unity 2017.3.1f1.

    edit:
    I've refreshed this prefab with Vegetation Studio and it shows up now. It is invisible in editor and player with its ATG foliage shader though.

    So after playing a bit with VS and ATG I've managed to set my scene fine. I came across a different problem that has appeard. I have no preview of a prefab with ATG shader attached to it. It isn't a big problem normally, but when I use 12-20 prefabs with Vegetation Studio I can't see them in a selection tab. Is there any way to fix this? Lennart said that he can't do anything about it.

    This is how it looks now:

    2018-07-01_13h45_25.jpg
     
    Last edited: Jul 1, 2018
  31. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    75
    Hi @larsbertram1 i'm trying to use ATG (VS Instanced Foliage Shader) with the NatureManufacture's foliage pack that has Vegetation Studio prefabs.

    I can get really nice results with incoming light from low points (sunset/sunrise) but with 'midday' light the grass get really dark in some meshes.

    I know this is not related with ATG, but, do you have any advice on how i can setup the models properly?

    GrassAndlight.jpg
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hmm, atg and vs work fine for me - even in unity 2018. please make sure you have added a "ATG Wind Prefab" to your scene.

    i do not know how and when vs takes the preview images. maybe adding the "ATG Wind Prefab" first and then the grass prefabs will help. but if you use atg with vs atg is just a shader - so i have no possibility to influence the preview as shown by vs.
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you should use the grass shader instead of the foliage shader. if you use the foliage shader the shader will use the normals as baked into the mesh. these are responsible for the "dark" faces here and there.
    only use the foliage shader on meshes which have distinguished planes like ferns.

    the grass shader simply ignores the mesh's normals and make them all point upwards.
    so lighting will be consistent for all faces of the mesh.
     
    Weendie-Games likes this.
  34. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    VS uses the standard unity preview of a prefab. I talked to Zaki_X today and the preview was empty when he selected the prefab in the project also.

    It might be related to the wind? it needs a default value in order to render when unity previews it?
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    @BlandonDu thanks for sharing your code. i guess some people here really appreciate it.

    and without going into details i just came across some issues:
    here you create new boundingSpheres which most likely will allocate... but as the number of spheres does not change you may simple skip that line.
    here you create a new BoundingSphere which you do not need.
    you should be able to simply change its position (if you do not clear the spheres as mentioned above):
    boundingSpheres.position = Cells.Center;
     
  37. Zaki_X

    Zaki_X

    Joined:
    Jul 5, 2016
    Posts:
    55
    @larsbertram1 @LennartJohansen - thanks for checking. I'm using Unity 2017.3, but I'll switch to 2018.1 soon and I'll see if it works there. Both assets (VS and ATG) combined are amazing!
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    @Zaki_X @LennartJohansen the grass isn't rendered in the vs preview because _CullFarStart and _CullFarDistance are not set by vs when you are in edit mode.
    so either vs sets both global shader variables in editmode or you have to edit the vertex function (in VS_GrassInstancedIndirect_Vertex.cginc) like so:

    void atg_vs_vertgrass(inout appdata_grassinstanced v, out Input o) {
    UNITY_INITIALIZE_OUTPUT(Input, o);
    // new:
    if (_CullFarStart == 0.0) {
    _CullFarStart = 100;
    _CullFarDistance = 1;
    }

    latter will make the shader a little bit slower tho.
     
  39. BlandonDu

    BlandonDu

    Joined:
    Dec 26, 2016
    Posts:
    10
    Thansk for the comments and advice taken. Incase anyone would copy part that code from Lars's comment, I guess
    otherthan

    Code (CSharp):
    1. boundingSpheres.position = Cells.Center

    it is suppose to be

    Code (CSharp):
    1. boundingSpheres.position = Cells[i].Center;

    //=====================================================

    BTW, I wonder how do we get a circular wind zone in the scene? I tried to place one in my scene , but it seems does not work .According to the way how the ATG wind system works (based on a render texture), do I need to operate a non-repeated render texture and draw something on it? I can barely think of this as a solution , but it would be great if the ATG could has it as a part of wind system. Should we expect it to be a future feature?


    KEYWORD: circular wind, spherical wind, moving wind zone
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    radial wind zones are currently not on my list.
    you could, yes. but you could also add an extra animation using some math in the vertex shader.
    another approach would be to pick up the idea of how to add touch bending which has been discussed on previous pages of this thread: so you may render e.g. a copter's windzone as somehow animated displacement field into a 2nd render texture (top down view centered on the current camera) and combine its values with the values from the wind texture.
     
  41. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Hey @larsbertram1 would it be possible to get some help with the problems I'm having -- posted above two weeks ago and another just below it last week, and also sent by PM on Monday (with a new question about performance).

    And in addition, I'm again having the problem where the ATG grass simply doesn't render sometimes. It was working just fine in a scene this morning, and then suddenly stopped working for no apparent reason. I've reloaded the scne, quit and relaunched Unity, even copied that terrain into a new scene, no luck. Won't render even if I disable/reenable the Grass Manager, or have the GrassSwitcher script on the camera and press 1 or 2. Completely baffling, and obviously a major problem.

    thanks
    Dave
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    @gecko sorry for my late reply. actually i thought i already answered your pm.
    and i did not see your questions from about 2 weeks ago. sometimes the forums simply do not send any notifications... but as you edited the post this might not be the fault of unity's forums this time:)

    atg always renders grass relative to the main camera which has to be tagged as such. but it might draw into other cameras as well (like mirror or reflection cameras e.g.).
    if you deactivate the main cam and switch to the alternate camera you have to tag this as "main camera" as well – as otherwise atg will not pick up its position to update the grass.
    you do not need to set "camera" to "all cameras"in the atg inspector as you always only have one active camera.

    i have no answer for this right now.

    which version of unity do you use right now?
    do you get any errors in the console?
    and what does the overlay show if you check "Debug Stats"? if the number of "cells to init" never goes down but stays the same or even grows over time, the worker thread might error.

    in order to get around some common pitfalls:
    make sure the game view fully expands at play mode.
    and that there is no 2nd camera rendering.
    also make sure that your camera is tagged as camera.main.
    last but not least you can try to check "ignore visibility".
     
  43. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks for the reply -- and the Skype call to look into these more. For the first item: Okay, we'll see about tagging the currently-active camera as MainCamera.

    For the second: looks like we sorta figured out that problem (was due to disabling/re-enabled the Grass Manager, which can cause odd things to occur.) But FYI for other users: If you want to experiment with different render settings (distance, density, etc.), you can't do that at runtime (which I knew) and not even with the SwitchCamera script/function (which I didn't know). Lars says it's best to stop and restart runtime to see the effects of different settings.
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    oh, you can. the script will call a function which regenerates most data.
    so you can change density and distances at runtime (just hit "1" or "2" in the full demo).
    the only thing you can not change at runtime is the cell size or "buckets per cell".
     
  45. larsbertram1

    larsbertram1

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

    as grass rendering nowadays seems to have support compute shaders the next version of atg will introduce compute based culling.

    atg_compute01.PNG
     
    gecko likes this.
  46. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Great! ....but what does that mean? Faster?
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    on high end gpus: yes.
     
    gecko likes this.
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hiZ culling working – more or less:

    hizbufferworking.PNG
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    and finally: support for floating origins, so that you can create large open worlds and do not have to suffer any floating point issues.

     
  50. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Hey lars,
    first of all thank you for this amazing asset, it is absolutely awesome. The upcoming update also looks very promising.

    I have a problem that is probably due to me not reading something properly/not setting up the grass correctly.
    In unity editor everything works fine. The grass behaves as it should and looks fantastic.
    However, when I make a build, the 2d grass blades stop working correctly. The 3d plants using the foliage shader still work fine.

    Here is a video showing what is wrong. As you can see, the grass blades do not perform properly in the wind. They slide around instead of being attached to the floor. Your nettles work fine.
    https://drive.google.com/open?id=167qMTsFJj-T1bk-eX2vKejlLmIncv6tg

    Maybe you know what is wrong? I am on Unity 5.6.5p2

    Thanks a lot!
     
    Last edited: Jul 17, 2018