Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assets Critias Vegetation System [Asset Store]

Discussion in 'Works In Progress - Archive' started by Assembler-Maze, Sep 14, 2017.

  1. timothy92

    timothy92

    Joined:
    Mar 7, 2016
    Posts:
    12
    This is great, thank you very much :)
    I think a lot of people would benefit from you including this in the documentation under a "common problems" section or something.
     
    Assembler-Maze likes this.
  2. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Yes, I should. However that is a modeling problem rather than a system/code stuff and that is why i presumed that the modelers know what they're doing. But anyway, might be a pitfall so I'll add it to the list :)
     
    timothy92 likes this.
  3. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    For those interested, for the past day's I've been working with an tight integration and support for the 'Advanced Foliage Shader V5'. The integration is almost finished and supports my system quite very well.

    I'll update with more info as soon as possible.
     
    No0B25, 600, zmaxz and 1 other person like this.
  4. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    At the moment the following updates are planned for V1.2 and are work in progress:

    In progress:
    - Runtime hue variation changes
    - Grass shadow fade
    - Editor performance optimization
    - Disable the log in the UI
    - Tree cross-fade make it non-transparent when turning into a billboard
    - Better billboard lighting at sunset/sunrise (I'd need some example from someone though)
    - Examples for all kinds of functionality (really sorry for this one guys)

    Implemented:
    - Foliage stick to terrain in case of heightmap change
    - Detail extraction from multiple terrains at once is possible now
    - Per foliage type surface align options
    - Better painting
    - Advanced Foliage Shader 5 integration
     
  5. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    96
    Great stuff... please please please billboard shadow pass
     
    Assembler-Maze likes this.
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    Well, @Assembler-Maze has forgotten to mention that support for CTI trees will come as well.
    So you will not be limited to speedtrees and speedtree grass but can use your own meshes on grass, folaige and trees as well :)
     
    zmaxz likes this.
  7. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Yes, CTI too, that's work in progress too. But even at the current moment the system supports non-speedtree grass/trees or objects, so even at the current moment it is not dependent on speedtree only.
     
  8. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Added to the list.
     
  9. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Billboard shadows are back! 2 versions, with SpeedTree type shadows and additive simple shadows.

    Also fixed the hue variation for trees, now it is the same always for both the billboard and the tree. There was an issue with the data passed to the GPU (I don't know if anyone noticed it though).

    BillboardShadows.png
     
  10. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    I really benefit from this asset. Thanks for the great work. I have some feedback. I bold the key point as it's a bit hard to read.
    1. One problem that I encounter is that the maximum density settings is not dense enough. I need grass to be denser, and I can work around this by painting manually and using "extract" method. But the Critias Painter brush should be able to get higher densities directly.
    2. And if we already painted an area, we can't paint over it again with other details. This is hard as I can't place sparse stones between grass that I've already placed before.
    3. When we extract detail from terrain, we are required to select the detail from Critias painter that would replace the detail in the terrain. By default dropdown is set to "None". Can you make it such that, if the names of the details from the terrain and from Critias painter is the same, they will be automatically selected by default. The user then change from there.
    4. Can we define how many percent of each checked details element will be painted.
    5. Adding mechanism solely by drag and drop can be quite cumbersome, a mechanism that can select multiple prefab would be faster
    6. Being able to select more than one detail element in Critias painter to change the "Max Draw distance" and Enable shadow parameter would be useful. It's quite time consuming to adjust one by one.
    7. The lower bound value for "foliage density" can be lower. This is useful when placing meshes bigger than a grass such as rocks.
    8. Edit: I forgotten to add this. Can we save preset "detail group". Just presets of different combination of details selected. So for example for grass, all my grass details are selected, stones, all my stone details selected. Right now I have to uncheck and recheck everything over and over again.
    I'm just suggesting these improvements, but as it is this is a truly great asset at a very affordable price. I'll do an AB comparison once I find the time to ascertain my intuition.
     
    Last edited: Oct 18, 2017
    Assembler-Maze likes this.
  11. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    70
    Try increasing the detail resolution setting on your terrain. The higher it is, the denser the grass becomes and the more accurately you can place it. Keep in mind that changing the detail resolution will remove all grass from the terrain.
     
  12. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    Thanks for the tip. Yes I've done that. I can get a greater density using unity's own brush tool and TerrainComposer2 which is a automatic placement system
     
  13. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    96
    Yes, yes, yes !
    That's the one I was waiting for :)

    Right I'm off to the asset store to purchase...
     
  14. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    It is not live yet, it will come in V1.2, that will be submitted for review Friday or Saturday. Should be live next week.
     
  15. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hey, no probs, these are minor, I'd call utility functions that should fare quite nicely.

    I'd have some feedback on some of them, that might help you until I'd publish the next version:

    1. This problem might be related to the fact that you probably use quads or smaller meshes as foliage. Don't do that. Instead of having a single quad or something like that try and clump together more foliage in a single mesh. This is a good example:

    (I've omitted the texture mapping etc... for brevity)

    Really bad grass:
    BadGrassPatch.png

    Good grass patch:
    GoodGrassPatch.png

    And why is this example important? Performance... GPU instancing is awesome but you have to play by the rules. It works great with larger clumps of vertices but it won't be anywhere usefull if you use a ton of small (<10-20 vertex) instanced quads.

    2. Again because of the density I'll allow for a higher limit. You can also do that in the UI code, until I'll submit a new version, but it's on the list.

    3. Name based search, got it. I did not mapped that due to the fact that the name of a texture for example, might be different from the actual prefab that you'll replace, however I'll try to do a partial name match.

    4. That is per-instance paint density, which is quite fine, since that is how Unreal does it's thing.

    5. It's already there, lock the painter (with the little lock) and take all the prefabs you need and drop them all there.

    6/8. I'll see what I can do.

    7. If you set that type to "OTHER_TREE" and it has LOD's you can paint without problems.
     
    Exbleative and coverpage like this.
  16. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Even though not planned a new mode 'DrawMeshInstancedIndirect' was also added for grass types, if you have a shader that supports it. I've tweaked the default shaders that come with the system to support it. It is activated by settings the 'Render Type' to INSTANCED_INDIRECT. Shadows are not supported on that mode, but it should be mostly ok.

    Since you won't be sending a list of matrices to the GPU each frame there should be a good improvement on the project's FPS if you smartly use the indirect instancing:

    InstancedIndirect.png
     
    GingerDr73, No0B25 and coverpage like this.
  17. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Regarding the GPU requirements: If I stick with Tree Creator trees and use Critias only for grass billboards and detail objects, are those requirements lessened? (Sadly, even some fairly recent MacBook Pros don't quite reach 4000 on Passmark).
     
  18. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Seeing some weirdness with wind. A lot of the time the wind won't take, and the only way I've gotten it to work again is by re-applying the wind setting on the foliage itself, in this case SpeedTree. What this means is I have to change wind quality on the grass from 'Best' to <anything>, then immediately set it back to 'Best' to jump-start the wind into working again. But then, the wind will only animate the grass when viewed from certain angles, otherwise it immediately stops. And it's never the same angles; it's constantly changing from which angles the grass will draw from. Has anyone else run into this at all?
     
  19. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I had this as well, but thought I'd maybe incorrectly set the Wind Transform to the WindZone rather than the camera. After messing with a bunch of stuff at the same time I wasn't sure how I'd fixed it.
     
  20. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Made 2 identical test scenes, one with this tool and the other hand-placed, and in the hand-placed scene animations never stopped, from any angle. Fingers crossed there's a fix.
     
  21. aquay

    aquay

    Joined:
    Feb 23, 2017
    Posts:
    5
    I'm getting these two errors when creating a build for windows. Everything works OK in the Editor (v2017.1.1f1).

    Shader error in 'Critias/WindTree_Grass': Did not find shader kernel 'frag_surf' to compile (on d3d9)
    Compiling Fragment program
    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_COLORSPACE_GAMMA

    Shader error in 'Critias/WindTree_Grass': Did not find shader kernel 'frag_surf' to compile (on d3d11)
    Compiling Fragment program
    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_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME
     
  22. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hey, for the weird wind issue, I've pushed all the type a little closer to the camera so that I'm sure the camera sees it.

    Modify the code of the line 573 in 'FoliageTypes' to

    speedData.m_SpeedTreeWindObject.transform.localPosition = new Vector3(0, 0, 0);

    instead of the default -2f. I've done that and I haven't had any more problems with the wind, since I'm pretty sure the data is calculated now.

    And this is anyway a workaround. I've tried to manually calculate all the wind data. I've searched the millions of lines of code that Unreal Engine has in order to see how they calculate the wind data for speedtrees. However it always seems to me that Unity calculates it a little different and I'm always missing some piece of info when I've calculated it manually. Also the license does not allow you to manually calculate your wind (or so I think).

    But if after changing the location the problem still persists I'll try again to have some workaround again, but if that will fail I'll contact the Unity team again on a fix. This workaround of copying the wind data was again suggested by the unity team, so I hope they can give me another, more stable fix.
     
  23. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Fox DX9 it is expected. For the DX11 version, does it stop the build or something? I think I've god that error once but it did not stopped me from building the game and playing it. So it should be fine...
     
  24. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Well, I've just implemented on V1.2 the 'DrawMeshInstancedIndirect' API that 'might' fare better on a mac than the 'DrawMeshInstanced'. Maybe I could make a build demo with some foliage, trees and details for mac so that you can try it out. But I don't have time right now, trying to finish off V 1.2.

    However, I would really really not recommend my system, sorry.
     
  25. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    In V 1.2 that will hopefully come live next week we have distance based (like Uncharted) grass bending too, for people who are interested! Not a final solution, more like an experimental/beta one, but it is there!

    Bend.png
     
    GingerDr73 and No0B25 like this.
  26. aquay

    aquay

    Joined:
    Feb 23, 2017
    Posts:
    5
    You are correct, the Build does not fail and the exe can be launched by hand. However, Build & Run in the Unity Editor does fail as a standard shortcut. Also, our build servers will report this as a failure. So I would prefer to see the errors go away. Any ideas?
     
  27. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I think it might be a unity bug rather than a issue with my shader. The shader is very very close to the tree one that does not have any problem. Even the names are about the same. I am looking into it again, re-organized the shaders I hope that it goes away.
     
  28. aquay

    aquay

    Joined:
    Feb 23, 2017
    Posts:
    5
    Thank you very much for checking into the shader compile error.
     
  29. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I've just made a build (since the asset store submission) and the error is gone for me. I hope the new version will be beneficial for you too.

    P.S: For interested people, I think I will change the default demo that I've provided with the one that has the floating islands and the 'DrawMeshInstancedIndirect' API, maybe someone will find it better than the current stand-alone demo. A mac version might also be available in the future, for people wanting to test on mac too.
     
  30. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
  31. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Since it is an update not a review, it should be quite quickly. I guess that the next week monday/tuesday it will be live.
     
  32. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Hi there, I have a few questions:
    1) Can you submit it using unity 5.6? I can't upgrade to 2017 because it's an existing project and it would require lot of changes. Any reason why this system can't run on 5.6?
    2) Does it work on mac? If dx11 is mandatory, i'm not sure how that works on a mac.
    3) I'm not using speedgrass. I'm using regular unity grass on my terrain (2d textures). Do you support them and are they faster with your system than the default unity grass?
    4) Lastly, if you support existing unity grass, does it import into your system easily or i need to play around and do several steps like converting them to trees, etc, etc

    thanks
     
  33. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    1. Highly unlikely, especially due to the lack of some shader features & the 'DrawMeshInstanced' with the 'List<Matrix>' API. I don't think I'll reach anything substantial of the market for the huge amount of work I'll have to do to modify the existing data to 'might work' in 5.6

    EDIT:
    1. I know someone using it for 5.6, someone who requested a preview before release and, there were not any compatibility complains, but again, it is not supported by default

    2. I'm not sure, I think it should support OpenGL Core though. I'll see if I can rig a demo and test it one a mac. But again, it's highly likely that it might work

    3. It might be faster depending on your hardware and on how smart you make the grass. If you will draw simple instanced quads with my system it will certainly not be any faster, but it might be slower. If you use denser clumps of grass (not a single quad) it will be faster. However you will have to provide your own shader for the grass to work. I hope that in the next version I'll be able to add my own default grass shader for people not using speedtree but at the moment you can go for the advanced foliage shader v5 that is compatible with my system. For the good optimization of grass check the documentation under 'Common Pitfalls'

    4. You need to do the following to import your grass from the terrain:
    - Add it to the system as 'Foliage Types', you require your own shader and your own mesh for that (a grass prefab)
    - Extract it from the terrain's details with a very simple setup

    If you have the grass prefabs ready it should take you approximately 30 seconds. I hope that for the next 1.2 version I'll make a video demo showing the possibilities.
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it does. upcoming 'DrawMeshInstancedIndirect' although will only work using metal – openglcore on mac is not supported (as too old).
     
  35. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Great. 'DrawMeshInstancedIndirect' is not mandatory anyway, so all should be cool.
     
  36. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
    Hi @Assembler-Maze, just downloaded the new version from store; can't wait to test out new runtime color; quick question: how does it integrate with " Advanced Foliage Shader 5" - isn't it in a sense competing product?

    PS: Some of the shaders have bad include path for "CritiasUtils.cginc", and only works when CritiasFoliage is on root folder. All those includes should look like following:

    #include "../CritiasUtils.cginc"
     
    Last edited: Oct 24, 2017
  37. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hey,

    The AFS v5 is compatible with my system in the sense that you can use the shader on foliage that is added to my system. AFS is a shader while my system is, well, a mechanism for rendering a large amount of foliage. The fact that I provide some shaders is purely my decision, however it could work perfectly without any included shader. At the moment I've only provided SpeedTree shaders for the system so AFS should be a good addition if you want to use some grass without my SpeedTree shaders.

    In the future I'll plan to add a default grass shader that is not SpeedTree. However for other details like rocks & such I've added the other 2 shaders that should do just fine.

    But again, my system doesn't care what shader you use.

    Sorry for the 'root' thingy, you should move the whole folder if you want to move it somwhere else.
     
  38. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    V 1.2.0 is on the market with great improvements, I hope that it will improve your user experience! Don't forget to read the updated docs, and see the code examples!

    For any other problems or bugs, feel free to contact me via the support email, here on the forums or in a private conversation!
     
    600 and Exbleative like this.
  39. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
    @Assembler-Maze, that shader include error happens if I move critiasfoliage folder from root assets folder. Of course it’s the whole folder that I’m moving, and if you check the shader code, you would see that include statement is going up two levels where the file is one level up.
     
  40. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Delete your current copy and check out a new one since I've moved some things around. I've moved the shaders folders "Tree" and "Grass" in "WindTree" and modified the includes a little. And don't worry your grass file will not be lost.

    If after a new checkout the problem still persists tell me the shaders with the problems and I'll look over it since when I've updated the stuff on the store I did not had any error.

    PS: Just re-checked the version I've submitted to the store and everything seems to be in order.
     
  41. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    Unity5.6.3p4 CritiasFoliage1.2
    Get shader errors and speedtree Lod disapeear but billboard.

    Cs01.jpg Cs02.jpg Cs03.jpg
     
  42. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
    yep, that solved it.. sorry about that, unity didn't update file paths.

    sent you a PM.

    PS: with new version, hidden tree on camera is kind of visible - please see screenshot
     

    Attached Files:

    Last edited: Oct 24, 2017
  43. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    70
    Hey there!

    As promised I tried out v1.2 with the same scene from before on two different systems. Made sure the camera is positioned the same and the resolution and setup fits to make it just a bit more comparable (it really isn't, because the CPU and GPU have different architectures, but whatever). Also I don't think Unity's built-in FPS counter is even remotely accurate, but if it has the same amount of error everywhere (which I hope), then it's okay I think. This isn't really to compare the performance of the two systems anyway, but more reporting about their performance with and without the Foliage System. Both systems use Nvidia's 387.92 driver. Didn't get around to updating to the newest one yet. They also both run Windows 10 Fall Creators Update.

    So, first is my development machine (i7 7700K @4.8GHz, 32GB RAM, GTX 1080Ti, Samsung 960 EVO m.2). The update shows some significant improvements in performance in the editor, as the Update function now only generates about 15.5MB of garbage for the same amount of tree and grass instances, as opposed to something like 65MB. This makes the experience way more fluid, but of course there's still potential to improve it even further. I'd consider it useable now for small terrains with dense, or large terrains with relatively sparse vegetation. In my testing scene the terrain is 640x640. As far as I understood, the system in editor mode is constantly loading a file with the instance positions off the SSD, but unfortunately I can't really compare how my m.2 SSD fares vs. an HDD. For me the performance of course will be better in that regard vs. somebody who has their project on an HDD, which would be much slower.
    This is how performance looks in the game mode. First with and then without the Foliage System (I turned on the Unity terrain foliage to check the difference):
    https://c.lewd.se/01t1lW_2017-10-24_23-08-00.mp4

    Of course with this small resolution I get tons of FPS (don't mind the artifacts in the fog, I'm only trying out stuff), which are very inconsistent because of the video capture in the background. Performance is quite good and pretty stable without it. I don't have the grass in larger batches yet (so I need way more instances to fill the terrain), but I still tried out the DrawMeshInstancedIndirect option for it and found that the system is probably CPU limited in this scene without it. :D Because I just threw in the relevant code into the shader from the included grass shader, some of the grass prefabs are going crazy with their wind (the shader seems to F*** up the vertex position calculations at some point this way), but that shouldn't have too much of an impact on performance.
    https://vgy.me/4G4kkv.png - Without DrawMeshInstancedIndirect
    https://vgy.me/blXwZx.png - And with

    Then there's my notebook (i7 4710MQ @3.6GHz, 16GB RAM, GTX 870m 6GB, Samsung 840 EVO SATA). Here I don't have a reference point to before the update, but the editor performance is a little choppier here, as the painter is loading its file over and over again. It generates of course the same amount of garbage, but produces about 100ms spikes every other frame. This is worse than on my development machine, but that's probably due to the SATA SSD, which read speeds aren't as good.
    Because the GTX 870m isn't a particularly powerful chip (5-10% slower compared to GTX 680), I of course didn't get performance that good. :D
    https://c.lewd.se/K4WHz4_2017-10-24_22-16-21.mp4

    What's interesting here is that the standard foliage rendering stuff appears to be a bit faster than the Foliage System. That might change when I get to clumping the grass in larger batches, but it's still interesting. The system really seems to favor newer, more powerful chips. Here I also noticed that enabling DrawMeshInstancedIndirect only increased performance by a little bit (probably in the margin of error because of the fluctuation in FPS), because with this GPU, the scene is very much GPU limited. This is further backed by how the screen recorder only took a few FPS off (not like on the development machine).
    https://vgy.me/SSDUSc.png - Again without DrawMeshInstancedIndirect
    https://vgy.me/bDwL4S.png - And with

    When looking at the profiler I noticed a little bit of garbage (something in the realms of 120-150 bytes) being produced at runtime. Even though it's just a little, I'd like to see that gone if at all possible. :)

    I also noticed that something leaks a ton of memory when I start the game mode with the profiler with "deep profile" active. While I wait for the game mode to start, it slowly fills up whatever is left of the 32GB of RAM, so that Unity eventually crashes. But that might be totally unrelated to the Foliage System, I'll investigate some more. With how that is, I can't really tell where exactly the garbage of the runtime process of the Foliage System comes from though.

    Greetings,
    Jan

    EDIT: Oh by the way! I don't know whether you fixed it, but the wind animation on the trees still pauses when not between some random (as I too found out) angles. Seems to change everytime I start the game mode.
     
  44. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    75
    Hey, what about tree destruction, any plans to implement it?

    Thank you
     
  45. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Quote:
    "The system is not compatible by default with U 5.6 nor is it that supported. However if you replace the new 2017 'UNITY_POS' with the default 'float4 pos' used in 5.6 in all the provided shaders, you can get the system working with 5.6 too. Again, note, that it is not on the support list."

    For the 'ApplyDither' stuff delete that part that causes the error.
     
  46. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Tree destruction exist, you can add/remove trees at runtime. However you will have to provide your own animation of the tree when you get it out of the system.

    I might plan to try and do some tree destruction animation but it it uniquely that I'll get all that you'd require in a real game.
     
    Weendie-Games likes this.
  47. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Thanks for the detailed feedback!

    1. For the runtime performance having meshes instead of simple instanced billboards will make a HUGE difference and it is vital. There is a reason why particle systems don't use 'DrawMeshInstanced' it would severely slow them down. At the moment I'd find the tests a bit inconclusive since the vital artist optimizations doesn't exist. As your notebook, I really expect the system to behave even worse than the default Unity system if you don't batch together the instances as I've mentioned in the docs.

    2. For the editor performance, it re-loads the data from the disk every time you save or do something that causes the private field that holds the foliage instances to loose it's content. There might be other script or something else that causes your data to get refreshed since on my test-scene the data is loaded again ONLY when I press "CTRL+S" (a save). So your conclusion: "As far as I understood, the system in editor mode is constantly loading a file with the instance positions off the SSD" - Is partly correct, it should only happen very seldom. I know that Unity projects are kinda a spagetti of 3rd party addons that might cause you to loose the data however that is not my fault. Also I've thought to implement this stuff in C++ maybe and there I could set up a memory region that does not get lost when a save is posted in edit-mode. That would be the best approach, however adding a C++ lib there too would cause a ton of other problem. Maybe I'll be able to set a region of shared memory in C# that does not get lost when you do something with the editor.

    3. The 'Indirect' api should work just fine if you copy the setup I've added to my other shaders and set it correctly, else it might blow up around. I'm not sure what happens in your shader, sorry.

    4. I'm not sure about the memory leak, I've played hours and hours with my test scene and I haven't encountered anything too bad. Will look it up though.

    5. I've fixed the wind animation, it should work. If it doesn't I'll need a confirmation and I'll contact the unity support team with a workaround on their provided workaround maybe there is some hidden API or anything of that kind that will allow me to FORCE the wind calculations somehow. I really dislike the unity close box that requires stupid workarounds at other workarounds that 'might' or might not work.
     
  48. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    You can push the tree a little behind in code at the moment. As I've already told I also hope that I can do something smarter with those wind animations so that maybe we won't need those hidden trees.
     
  49. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    70
    @Assembler-Maze, the feedback is probably just a bit more detailed than what you'd usually get out on the Unity forums, but as you wrote, the test is flawed, so it's most likely somewhat worthless. Was basically to be consistent with the previous video(s). Now I'll get to clump the grass together and retest. :) Unfortunately Unity doesn't have some at least somewhat consistent benchmark utility...

    I believe that shouldn't happen here. In this scene I removed TerrainComposer after populating the terrain, so it must be either RTP (which I don't think it is) and nothing. Maybe I'm just misunderstanding something. I'll throw it all into an empty project and see if the spikes also happen every other frame there.

    You're right. I was jumping to conclusions there, sorry for that. After looking at the profiler again, it says that the garbage comes not from loading a file (and throwing the data of the previously loaded file out), but rather Array.resize inside of ProcessSubCell's List1.Add. There's also a few MB of garbage coming from List1.GetRange in the same function. So the problem simply stems from the way C# lists are implemented. :D On the development machine the spikes in the editor are only 80ms, so the stutter is visible, but workable. But realistically speaking that's also a thing that should at least get better (or vanish) when I clump the grass together, because then there will not be as many instances to loop through.

    Don't worry, that's going to be looked at. Right now it doesn't really matter how it looks, only how it performs. We'll get to make it more pretty (and make less ugly SpeedTrees) later on.

    As for the wind, here's a video that I just now took (with the wonderfully crazy grass): https://c.lewd.se/UJ7rCR_2017-10-25_11-02-09.mp4
     
  50. 600

    600

    Joined:
    Dec 18, 2013
    Posts:
    385
    Yesterday found a major frame drop with Critia, but it was related to SSAO Pro (asset) camera effect. Now disabled the effect and all works as expected. With the SSAO effect trees on terrain on Unity default system works better.

    I am not so technically in knowledge with these things so no idea which asset could have an update regards this or even if they are meant to be used together.

    Thanks for making this asset. Great stuff!