Search Unity

[NEW PATCH] uNature - GPU, Interactable Grass. Interactable Trees, MultiThreading and more!

Discussion in 'Assets and Asset Store' started by ElroyUnity, Apr 29, 2016.

?

Pre-release Integrations

Poll closed Nov 29, 2016.
  1. TerrainComposer2

    43.1%
  2. GAIA

    54.9%
  3. GENA

    49.0%
  4. World Creator

    13.7%
  5. World Streamer

    37.3%
  6. Map Magic

    27.5%
  7. Landscape Builder

    0 vote(s)
    0.0%
  8. SkyMaster ( Weather )

    7.8%
  9. InfiniGrass, AFS, DX11 (Integration will provide built-in shader support)

    33.3%
Multiple votes are allowed.
  1. kaamos

    kaamos

    Joined:
    Aug 6, 2013
    Posts:
    48
    Thanks for the info! And to be clear, this will run right in a very large world, say 10x10 terrains for a total world size of about 20 square km (which is why I have so many trees)?
     
    ElroyUnity likes this.
  2. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Oh sorry, didnt see you said trees, I meant grass. For trees it wont change much of the spikes as uNature just removes the physics overhead while for grass its a different story.

    Sorry for that :)
     
  3. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Hey @ElroyUnity, this looks awesome :) Is there any way to trial this, check it works well in our setup?
     
    ElroyUnity likes this.
  4. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey!

    No, not at the moment. maybe in 2 months or so.
    For now, you could just try out the asset, and as long as you request a refund on a reasonable time from the purchase date (around 1-2 months), I will happily refund you :)
     
    mimminito likes this.
  5. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Any progress on runtime procedural content? =]
     
    ElroyUnity likes this.
  6. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Very generous of you, thank you for the help. Going to speak with the team and see if its something we can use :)
     
    ElroyUnity likes this.
  7. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yes,
    The runtime demo is included with the new beta :)
    [PM me with your invoice and email and I will add you to the GitLab repository]
    Sounds awesome! keep me updated :D
     
  8. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Can work in mobile platforms?
     
    ElroyUnity likes this.
  9. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Seems to work well on IOS
    But android is a bit bugged (currently being fixed) as phones (3.0 and 2.0) works well but tablets don't.


    [Note that most of the calculations happen on the GPU so not sure how it will perform on some low-end phones]
     
  10. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I see MapMagic efforts in the Git. How does implementation work? I don't see any custom MapMagic generators?
     
    ElroyUnity likes this.
  11. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Basically you need to pull the latest push of MapMagic from @Wright 's repository and enable the map magic integration in the extensions, create foliage manager in your game scene and that's it :)
     
    malkere likes this.
  12. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I have pulled the latest version from GitLab, but I am getting this error, even on a brand new scene with just a single terrain:
    I have had uNature foliage working (once), and the demo scene did work - but now even that has stopped working. At one point I could see the shadows cast by the foliage, but not the foliage itself (in the editor).

    I am using 5.6.0f3. Tried creating a brand new project with just uNature, but the shader error keeps coming up now. Any ideas?
     
    ElroyUnity likes this.
  13. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey!

    Thanks for the report, might be a 5.6 thing. Will test it in the next hour or so and push a fix :)
     
    simonjewell likes this.
  14. impactit

    impactit

    Joined:
    Jan 28, 2015
    Posts:
    41
    Hey

    I got shader error when Speed Tree shader is replaced:

    Shader error in 'uNature/FoliageShader_Basic': invalid subscript 'instanceID' 'UnitySetupInstanceID': no matching 1 parameter function at line 179 (on d3d11)

    Compiling Vertex program with DIRECTIONAL INSTANCING_ON
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_HARDWARE_TIER3

    Unity 5.6.0f3 :)
     
    ElroyUnity likes this.
  15. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Okay just fixed the instancing issues with 5.6 :)

    Going to push it now.

    Also here's a comparision between without GPU Instancing and with GPU Instancing:

    Without:


    With:




    Note that the grass and the terrain are the only things in the scene, so it obviously wont increase your performance by that much, I simply wanted to show how it reduces the overhead :)

    In the picture - full density at 300 view distance.
     
    impactit, malkere, masa045 and 4 others like this.
  16. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @ElroyUnity

    I send you invoice by private to send me the latest beta version of 2.2.

    regards
     
    ElroyUnity likes this.
  17. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yep just answered :)
     
  18. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Just want to make sure, did that work for you?
    Trying to get some people to test it. Currently testing it on my own in my personal project, but more testers would be useful :)
     
  19. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    Things are definitely better on 5.6 now - with a new scene I can draw grass and it looks lovely. But in my existing scenes the grass cannot be seen - but the shadows from the grass can!

    uNatureNoGrass.jpg

    Here is an example - you can see the edge where I stopped drawing grass, and the shadows are most visible on the road.

    Actually - I just zoomed out and found the grass, way up in the sky like clouds!! uNatureNoGrass.jpg

    Interesting effect! Any ideas?
     
    ElroyUnity likes this.
  20. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Haha that's quite interesting :D

    One thing to try is move your scene to a unique layer (if you haven't already, as maybe something is blocking the colliders to the terrain?) then, go over to the Foliage Manager window, and remove the "Default" layer from the generation masks (Press no in the dialog) and then choose the layer you created for your terrain (this time press yes) and let me know if that works :)
     
  21. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I had not yet applied for access to his git, I've modified his scripts for my own project I don't want to reimport them there. I applied last night though and will start up a test project to play with it as soon as he gets around to granting me access.
     
    ElroyUnity likes this.
  22. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I found the problem - I am using the Critias Tree System, which uses Sphere Colliders for each grid. Your paint brush was being blocked by these. Could we maybe have a node mask to choose which layers can be drawn on? For now I will put a quick hack in to enable the sphere colliders at runtime, then disable them in the editor.
     
    ElroyUnity likes this.
  23. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Ah yes, thats what I suggested in the comment above :D

    An tutorial video would be -


    The video was recorded on V2.1 before it was out in the store, so basically when ever you have that dialog after changing the generation mask simply press "Yes"
     
  24. YOAJ1

    YOAJ1

    Joined:
    Jul 17, 2014
    Posts:
    26
    I do not want to revive trees after cutting.
    What should I do?
     
    ElroyUnity likes this.
  25. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    You can disable that on the Settings (Window/Settings)
     
  26. YOAJ1

    YOAJ1

    Joined:
    Jul 17, 2014
    Posts:
    26
    I made a mistake.
    Restarting the game will revive the cut trees
    I want to save the cut tree state.
     
    ElroyUnity likes this.
  27. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    You'll need to study persistent data for that. I write terrain changes out to a file, check to see if the file exists on reloading, and apply to saved changes during reload if it did exist. You mostly use FileStream and BinaryFormatter which are very well documented on the forums with lots of examples on how to use them.
     
    YOAJ1 and ElroyUnity like this.
  28. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yep,
    it's not a built-in feature, but should be fairly easy to implement by just saving the data to a file and loading it again when you go out of playmode, like @malkere said.
     
    YOAJ1 likes this.
  29. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi

    I think it would be a good feature to come with uNature by default ... And if it does not cost a lot doing so it could come in the following updates. It would be fantastic

    regards
     
    ElroyUnity likes this.
  30. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    I will probably add it to the trello to V2.3 (next version)
    Happy to see there's some demand for it at least :)
     
    masa045, John-G and ftejada like this.
  31. Paxew

    Paxew

    Joined:
    Apr 8, 2014
    Posts:
    30
    Hi Elroy

    I'm using the harvestableTree script and I'm trying to spawn an item when the tree start to fall.

    But I'm having issues getting the postition of the tree. I'm trying the spawn the item inside the HandleTreeInstanceDeath() function. But it seems when I try to get the position it always return the position of the previous tree.

    I.e when the first HandleTreeInstanceDeath() runs the position returned is 0, 0, 0 and when I fell the next tree it returns the position of the first three, and then when I fell the third tree it returns the position of the second tree I felled and so on..

    I'm trying to get the postion of the tree using transform & _gameObject.transform & rigid.transform inside the HandleTreeInstanceDeath but they don't return the correct position. What should I do to get the position of the current tree that I'm interacting with?

    This is what I'm trying at the moment.

    Code (CSharp):
    1. public override void HandleTreeInstanceDeath()
    2. {
    3.     base.HandleTreeInstanceDeath();
    4.  
    5.     Debug.Log("Pos: " + _gameObject.transform.position);
    6.     Debug.Log("Pos2: " + transform.position);
    7.     Debug.Log("Pos3: " + rigid.position);
    8.  
    9.     GameObject wood = Instantiate(Resources.Load("woodItem"), _gameObject.transform.position, _gameObject.transform.rotation) as GameObject;
    10. }
     
    ElroyUnity likes this.
  32. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey, sorry it was my fault, the moving position code was initiated after the death callback was called.
    Could you send me your invoice privately and I will send you a fix? :)
     
    Paxew likes this.
  33. Paxew

    Paxew

    Joined:
    Apr 8, 2014
    Posts:
    30
    Thanks :) I sent you the invoice by mail.
     
    ElroyUnity likes this.
  34. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Cool :) sent!
     
  35. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Hi
    I was checking the reviews on the store and it said 2.0.5 would improve performance drastically and probably run on mobile. It's on version 2.1... but I don't see much info. Does it work well on mobile?
     
    ElroyUnity likes this.
  36. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey!

    Sorry, V2.0.5 was actually renamed to V2.1, and in the latest beta it runs well on android (with 2.0 & 3.0) but seems to be bugged on tablets. still being addressed and will be fixed in the next few days.

    Regarding IOS, haven't yet heard a report regarding that :)
     
  37. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    runs well on android meaning? got any perf stats?
    having a demo apk to download and test on my device would be great!
     
    ElroyUnity likes this.
  38. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Well considering uNature is based on the GPU and some of the mobile phones out there have a really bad one I still don't think you can just use unlimited density like you can with PC, but it should still be reasonably possible.


    Will try to get a demo out when the system works for tablets too :)
     
  39. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    Is there a way to totally reset uNature for a given scene? I seem to be getting strange behaviour now - as an example, I destroyed the foliage manager, created a new one and started painting again. I suddenly had large areas covered with grass where I had not painted:
    uNature_StrangeGrass.jpg
    This was painted using the 14th grass prototype I added - which I have not used yet. Similar things happen if I clear a chunk - once I start painting again random areas of another prototype will appear. uNature_StrangeGrass.jpg
    In the image above, I cleared the chunk and painted the large area at the bottom of the screen - the green grass just appeared. By using the erase brush on that area, I worked out that it actually contained every grass prototype - only when I had erased using each prototype was the area clear of grass!

    Also, would it be possible to make the erase brush clear all grass? That would be really convenient.
     
    ElroyUnity likes this.
  40. Christopher-Kaminski

    Christopher-Kaminski

    Joined:
    Oct 26, 2016
    Posts:
    15
    Hi,

    I've encountered an issue with uNature, grass added to the terrain floats slightly above the ground and console pops up some errors as well. I'm attaching a screen showing the issue with errors.

    Advanced Terrain Painting isn't working for me as well and it doesn't show any errors in console.

    UNature.JPG

    I'm currently on Unity 5.6.0f3, using uNature with World Creator 2 v2.2.3.
    I've tested uNature with standard Unity terrain and the grass is floating as well.

    Any help would be greatly appreciated :)
    Thanks in advance,
    Chris
     
    ElroyUnity likes this.
  41. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Very strange, I think I've seen something similar, are you in the beta? (I remember fixing that)

    Also, try destroying the foliage manager and removing the FoliageDB asset in uNature/Resources
    Hey, seems like the advanced painting doesnt work because of the errors in the attached picture(will check them out in an hour when I get home :)), further more is your terrain layer included in the gemeration mask in the foliage manager window?
     
  42. Christopher-Kaminski

    Christopher-Kaminski

    Joined:
    Oct 26, 2016
    Posts:
    15
    Allright, I've added terrain's layer to the Map Generation setting, however grass still floats above it.
     
    ElroyUnity likes this.
  43. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Make sure to also remove the "Default" layer from it and press "Yes"
     
    Christopher-Kaminski likes this.
  44. Christopher-Kaminski

    Christopher-Kaminski

    Joined:
    Oct 26, 2016
    Posts:
    15
    Oooh, that was it! Thank you so much for your help :D
     
    ElroyUnity likes this.
  45. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Anytime :)
     
  46. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I have already tried removing the FoliageDB asset - if anything that made things worse! I'll grab the latest copy from GitLab, clear out the FoliageDB again and see if that improves things.
     
    ElroyUnity likes this.
  47. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Sounds good,
    If you can, try reproducing that on a new project and send it over to me I will definitely take a look :)
     
  48. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I grabbed the latest version and it looked good. Until I painted on a second chunk, and saw all this grass!!
    uNature_StrangeGrass.jpg
    I'll try to reproduce this on a new project.
     
    ElroyUnity likes this.
  49. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Ouch,
    Okay keep me updated!!
     
  50. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I have managed to recreate it in a new project - here is a link to the project.

    It looks like the foliage is repeating over different chunks. The "WierdGrass" scene (oops, typo) contains just a single terrain - try creating the FoliageManager then painting some recognisable shapes like a cross on one chunk. Then paint some dots on other chunks - as soon as the new chunks are created I am seeing the grass pattern from the first chunk repeated on the new chunks. Also helps to set the foliage distance to 500.

    Hopefully you can reproduce this too! If not, I'll record it happening on my screen.
     
    Last edited by a moderator: Apr 8, 2017
    ElroyUnity likes this.