Search Unity

Nature Renderer: Better terrain detail rendering ✅ PBR ✅ Custom Shaders ✅ Shadows ✅ Wind ✅ SRP

Discussion in 'Assets and Asset Store' started by Visual-Design-Cafe, Oct 3, 2019.

  1. Fobri

    Fobri

    Joined:
    Jan 28, 2014
    Posts:
    22
    Hey

    Your new version fixed the error and Nature Renderer works perfectly in the editor. However it still doesn't work when I build the project. I've tried every way possible but the grass just doesn't show up. I don't know what more I can do.
     
  2. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    That's strange. The code should work exactly the same in the editor (runtime) and in a build. Can you let me know the following:
    - Are there any errors in the log after running the standalone version?
    - For which platform are you building?
    - Make sure that there is a Global Wind component in the scene.
    - Does it work with a simple terrain with Nature Renderer (with the same terrain details) without procedural generation? It might be a rendering issue in the build instead of a streaming issue.
     
  3. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    951
    I get two of these:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. VisualDesignCafe.Rendering.Nature.NatureRenderer.RebuildBuffers (UnityEngine.TerrainChangedFlags flags) (at C:/Compiler/NatureRenderer.cs:176)
    3. VisualDesignCafe.Rendering.Nature.NatureRenderer.OnEnable () (at C:/Compiler/NatureRenderer.cs:229)
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    5.  
    When building for Universal Windows Platform with Il2CPP. It seems to have broken the build.
     
  4. Fobri

    Fobri

    Joined:
    Jan 28, 2014
    Posts:
    22
    Hey

    It works now! Seems like the reason it wasn't working was because there wasn't a global wind component in the scene. I had no idea that it was mandatory so you should probably mention it somewhere. If it is mentioned somewhere I'm sorry, I must've missed it.

    Thank you for all the help. We really appreciate it.
    - Fobri
     
  5. Fobri

    Fobri

    Joined:
    Jan 28, 2014
    Posts:
    22
    Onto next problems...

    Now that it works, the performance is god awful. Without Nature Renderer I'm getting about 80 frames and with it 25~. Detail distance is 200.
     
  6. Fobri

    Fobri

    Joined:
    Jan 28, 2014
    Posts:
    22
    Hey
    I noticed that if you increase the detail distance from the terrain settings you can still see the default grass rendering. Wouldn't it be better if the grass got removed from the terrain, and only have it on Nature Renderer? It seems a waste of memory to have them there for me.
     
  7. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I'll send you the latest build, that should fix the issue.
     
  8. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Can you share a screenshot of your scene, as well as the debug info in the Nature Renderer component? It should be possible to optimize to get a better framerate. Also, can you let me know what you are comparing with? As far as I know, HDRP can't render any terrain details without Nature Renderer.

    If you want to change the detail distance then you should change it in the Nature Renderer component. Nature Renderer will force Unity's render distance to 0 to prevent the default system from rendering any details. Both Nature Renderer and Unity load the terrain details from the same data, so no memory is wasted.

    I just double checked and looks like it is not specifically mentioned in the docs. I'll make sure to add it!
     
  9. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    Hello Nature Renderer, any news about character colision with grass? I am really excited to put my hands on your asset =D
     
    ikemen_blueD likes this.
  10. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I am researching different methods for interactive grass at the moment. A simple version should be added in the next update or the one after that. There is not specific ETA yet.
     
  11. LiveOverflow

    LiveOverflow

    Joined:
    Jan 27, 2019
    Posts:
    13
    Hello!
    I have an issue where the grass disappears when I enable the Nature Renderer Script on the Terrain.
    • URP + Unity 2019.3.0f5
    • Terrain generated with Gaia, but modified Assets (using SYNTY Nature Pack grass and trees). Disabled Nature Renderer with working grass is screenshot debug3_disabled.png
    • Debug Draw Cells and Draw Batches draws the boxes/grass where it is supposed to be (debug1.png)
    • Grass not showing up with Nature Renderer enabled
    • No errors or warnings related to terrain, rendering, nature renderer, ...
    Any ideas or additional info you would require to figure out what I do wrong?
     

    Attached Files:

  12. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Can you check if there is a Game Object with a "Global Wind" component in the scene (https://support.visualdesigncafe.com/hc/en-us/articles/900000032123-Edit-Wind-Settings)? Sometimes the grass does not render if there is no wind in the scene. That is usually the cause if the grass does not show (I am working on a fix for this).
     
  13. LiveOverflow

    LiveOverflow

    Joined:
    Jan 27, 2019
    Posts:
    13
    Thanks for the suggestion! It didn't solve it though.

    Experiment 1
    I have experimented with the test scene, because that scene works. However when I add the SYNTY Nature grass and paint it onto the terrain, that SYNTY grass will also not be visible. While the default grass on that terrain works fine.

    The grass in the test scene is a mesh though, while the SYNTY grass is a simple texture. I thought that could be a difference, but when I added and painted some mesh foliage by SYNTY, it also doesn't get rendered. Does this kind of observation ring any bell?

    Experiment 2
    I have created a new test project in Unity 2019.3 without URP. Now the grass doesn't disappear, but has very weird color. Looks like a shader issue?
     

    Attached Files:

    Last edited: Jan 23, 2020
  14. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thanks for the additional details. I have tested it and I can confirm that grass textures do not render in Scriptable Render Pipelines. I am currently looking into it but have not yet found the cause.

    Meshes should render correctly though. I double checked with some assets from Synty and they render fine here.

    The colors in the screenshot indeed look strange. Can you go to the detail settings and make sure that both the 'Healthy' and 'Dry' colors are set to white?
     
  15. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    Hi

    I purchased Nature Renderer as well and the Open World Nature Kit Asset to go along with it. They work well, at least I can now put grass in my HDRP project. The problem is that it absolutely kills performance in the scene view. I have the LOD's set to cull pretty quick, the detail distance is almost minimal. Yet it brings my CPU usage to 100% and locks up my entire computer.

    I have an Intel i7-6700k running at 4.0GHz with a GTX 1060 6GB and 16GB of RAM. I shouldn't be having these issues. When I run the game though it works great.

    I've tried disabling the nature renderer component on the terrains while editing and working but it doesn't seem to make a difference. I'm using Unity 2019.2.14f1 and HDRP version 6.9.0.

    Is it the version of Unity i'm using or are there settings I can change to make it more performant?
     
  16. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for purchasing both! Nature Renderer should work fine in that version of Unity + HDRP.
    This issue can happen sometimes for very large terrains with large amounts of detail objects. I just published a new version of Nature Renderer that should fix it. Can you go to Help > Nature Renderer > Check for Updates to download the update and give it a try?

    If the issue persists in the latest update then could you let me know the following:
    • A screenshot of your scene and the statistics in the debug section of the Nature Renderer component. That should give me a good indication if this is a performance/settings issue or a bug.
    • It might be that another script is editing the terrain constantly, causing Nature Renderer to refresh/rebuild the terrain constantly. Please check to make sure that no scripts are editing the terrain.
     
  17. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I have just published a new version that fixes this issue. Grass textures should now render correctly in URP. Please go to Help > Nature Renderer > Check for Updates to download the latest version
     
  18. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Version 1.1.6 is now available for download through the Package Manager and will be available on the Asset Store within the next few days. You can go to Help > Nature Renderer > Check for Updates to download the update.

    Changes:
    • New: Detail Streaming. Terrain details are now streamed-in while playing instead of loaded for the entire terrain at startup. This improves performance and drastically reduces memory usage.
    • Changed: Improved performance when editing terrain.
    • Changed: Detail Distance can now be set through code.
    • Changed: Better Frustum culling algorithm. Terrain details are now culled correctly for any camera angle and are culled more accurately.
    • Changed: Overall performance improvements.
    • Fixed: Grass Textures now render correctly in LWRP, URP, and HDRP.
     
    Mauri and transat like this.
  19. localhost

    localhost

    Joined:
    Dec 9, 2012
    Posts:
    43
    Hi!,

    If my detail distance is set to for example 50...
    What should my stream in distance and stream out distance be?

    Thanks
     
  20. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The stream-in and stream-out distance are added to your detail distance, so there is no need to change them. (The default values should be ok for most situations)
     
  21. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    951
    Is anyone else getting glitches like this after baking lightmaps? I thought it was my shader at first, but it happens with the example shader as well.

    Interestingly it only seems to happen in the chunks that are visible when the game starts, with the colour change being the most pronounced in the center chunks. Note that this is not the scene origin.
     
    Last edited: Jan 28, 2020
  22. LiveOverflow

    LiveOverflow

    Joined:
    Jan 27, 2019
    Posts:
    13
    I still can't get NatureRenderer work with the Synty grass :(

    I created a new scene for testing (happy to share the project with you):
    • Unity 2019.3.0f6. built-in rendering.
    • NatureRenderer 1.1.6.18
    • Synty grass detail texture (no mesh).
    • I also set the color to white (this indeed fixed the weird color from #113).
    The grass gets some shading, but I don't really understand how the color can be controlled of the grass, when it has to be set to white.

    Sorry for not checking the documentation first regarding the white color, but I read the asset description and I expected it to just work :D:
    "Get better vegetation, detail object, and tree rendering for your terrain. With a single click. [...] We just render it better and faster."

    But to be honest, I find the documentation a bit unhelpful. My only guess is now that I have to set a billboard material(?), but I have no clue how to make one. An additional example to work with billboard textures would be great!

    Also nice update with the streaming! that seems very useful! Thanks!
     

    Attached Files:

  23. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    So I've updated to the newest version, 1.1.16 I believe. It still spikes my CPU usage to 100% and locks up my computer sometimes. I notice good performance during run time. I get around 70-80 fps when playing the game.

    So the issue is in the editor, it gets choppy and laggy.

    I'm using Unity 2019.2.14f1, HDRP 6.9.0. I have no scripts editing the terrain at all.

    I do have large terrains that are kind of separated by tall mountains.

    I've included a screen shot of my problem area.

    I'm not sure if I need to upgrade my HDRP or Unity version, I've been avoiding that in fear of breaking my project haha.

    Also if you have any advice on how to get the post processing set up just right that would be appreciated. I tried to copy the PP profile in the packages but it's for the old post processing stack. The new HDRP stack is different.

    You'll have to zoom up a bit on the picture to see the numbers. It looks like it chopped some info off of the side but it's all there.
     

    Attached Files:

  24. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It is an issue with the light probe sampling, it should work fine in the latest build (version 1.1.6.18). You probably didn't get an update message because I sent you a custom build last time. I'll send you a direct download for the latest version by PM.
     
  25. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I looked into it more and found that it is an issue with the HSV color correction in the shader when using grayscale textures. I always assumed textures to have color so I didn't notice this issue before.

    The main issue is in the shaders and I have not yet been able to fix it, but I managed to create a small workaround for grass textures for you. I'll send you a download link to the latest build.

    With the fix you should be able to use the Healthy and Dry colors as you like. If you need to use detail meshes with a white texture then you'll have to edit the texture (and give it some color) for the time being.
     
    LiveOverflow likes this.
  26. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thanks for the details. I'll send you the latest build with more performance improvements. The scene view cameras could cause some additional performance spikes on the CPU when streaming in the current build.

    Based on the statistics it looks like your detail distance is very large though (I see there are 600 cells loaded, which is quite a lot). I recommend to keep the detail distance as low as possible to get the best performance.
     
  27. localhost

    localhost

    Joined:
    Dec 9, 2012
    Posts:
    43
    Hi

    I have two cameras, a vehicle and a player. Camera transitions when they enter the vehicle.
    How can i make Nature Renderer recongise the new camera when the old one is disabled and new one is enabled?

    Thanks
     
  28. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Should be completely automatic. Just disable/enable the cameras that you need. Nature Renderer should automatically hook into the rendering pipeline and render for the correct camera.
     
  29. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    So I recently upgraded to Unity 2019.3. It didn't break my game thankfully :D. It appears that the performance issues have been sorted out through the newest version of Nature Renderer. Also the grass is looking a lot more lush and full now.

    I have just a couple of questions.

    Grass - I'm using/experimenting with the default "GenMed" grass detail mesh that comes with the Nature Renderer package. I'm having some issues with the colors at certain angles. If I'm low to the ground and against the aim of the directional light, the grass looks amazing. It has a nice toned bright color and looks basically like you'd want. The issue is at other angles the colors look too saturated and if I adjust the colors of the mesh detail in the terrain options the bottoms of the blades start to look way to dark/black.

    Is this something to do with the mesh? Or something to do with post processing. I've been experimenting with PP quite a bit and I can't seem to fix this.

    Then my other issue is that I'd like to have two different grass meshes on my terrain following my character. One close to my Character that is rendered at a "Detail Distance" of say 20-30 that is very lush and full. I'd like another detail mesh that renders further out, say 50-60 that's less lush and better for performance. This way the grass around the player is really nice and the grass further out is better for performance.

    I can't add a second nature renderer component to my terrain, is there another way I could make this happen?
     
    Lars-Steenhoff likes this.
  30. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Sounds like you are describing the specular highlights from the directional light. You'll only get that at the angle you are describing. You should be able to adjust the color of the mesh detail without any problem though. If you move the Healthy/Dry colors more towards white then you should get the desired effect.

    You can achieve this with a LODGroup (https://docs.unity3d.com/Manual/class-LODGroup.html). You can use a lush/full detail mesh for LOD0 and set the culling distance to 20-30 and then a less detailed version as LOD1 with a culling distance of 50-60.
     
  31. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    Ohhhh LOD's. That's perfect. I haven't gotten into making my own LOD's yet, although I am using some from various packages. I'll start looking into that. Thank You.
     
  32. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    So my performance issues with CPU useage hitting 100% are back. This time I'm getting an error "Default rendering shaders not found for active pipeline.

    I have another project on my laptop that isn't using Nature Renderer and does not have this problem. Both projects are using Unity 2019.3.

    I'e attached an img of the script the error seems to be coming from.

    Any ideas on what I could try to solve this?
     

    Attached Files:

  33. maffffffffew

    maffffffffew

    Joined:
    May 17, 2013
    Posts:
    5
    Moved to the Universal Pipeline. New scene, all my materials work and stuff except for nature renderer trees.

    I have your open world nature kit. All the trees/flowers/bushes come out as black for some reason.

    upload_2020-2-10_11-55-18.png

    upload_2020-2-10_11-55-39.png
     
  34. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The error is from HDRP itself because the render pipeline does not have its own shaders but still tries to load it.
    I am working on improvements for the CPU usage and I'll send you an update within a few days.
     
  35. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It looks like there was an issue with converting/importing the materials. Some of the textures are not set (such as the Metallic/Occlusion/Smoothness map) and based on the screenshot it looks like some of the other textures are incorrect as well. Can you try to download and reimport the entire package?
     
  36. Vad3rInHale

    Vad3rInHale

    Joined:
    Apr 19, 2015
    Posts:
    96
    Hello,

    Using default Unity Terrain, it is difficult to override the default shaders for grass & detail mesh (Using 2019.3.0f6).
    Also, I've noticed that my textures get compressed to some low number (Around 1K) when painting these onto the terrain. Have you noticed these with the built-in terrain system and does this plugin help with these issues?

    Thanks
     
  37. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Yes, we noticed it as well in the built-in system. Nature Renderer completely fixes these issues. You can use full-res textures for all your terrain details and custom shaders for each detail object. Nature Renderer will use the shader that is set in the material of the detail object, so it is very easy to change.
    If you want to give it a try, you can download a free trial.
     
  38. Vad3rInHale

    Vad3rInHale

    Joined:
    Apr 19, 2015
    Posts:
    96
    I've downloaded the trial and am giving it a run. Whenever I change a Prefab of a detail mesh I've placed on the terrain, it doesn't automatically update, but does when I turn on/off the terrain object or NatureRenderer component. (I would expect hitting 'refresh' on terrain component detail mesh painting tab would do this).
    Is there a better way to do this?
     
  39. Vad3rInHale

    Vad3rInHale

    Joined:
    Apr 19, 2015
    Posts:
    96
    upload_2020-2-13_20-50-27.png
    See here, I've changed the color of my material, and updated the prefab. It shows up in the terrain component preview as updated, but the meshes on the terrain aren't following. I've even turned off/on the terrain object and nature renderer component in this case...

    Even painting new detail meshes doesn't have updated color.

    Noticed that smoothness and cutoff update in real time, does NatureRenderer only support certain transformations for shaders?
     
  40. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Can you let me know what you are editing in the prefab that does not update immediately? Everything should update automatically, but it is possible that I missed a property.

    The color is loaded from the Healthy and Dry color in the detail settings and not from the material. So please change the color there and it should work correctly. All the other properties are updated from the material directly, only the color is loaded from the terrain settings to match with Unity's workflow.
     
  41. Vad3rInHale

    Vad3rInHale

    Joined:
    Apr 19, 2015
    Posts:
    96
    Ahh okay, I just changed the one thing that isn't supported, figures lol. Thanks for reply. Will be doing more testing and will come back if I have questions or decide to purchase.

    I'm working on Oculus Quest, with has a mobile GPU. Is there anything NatureRenderer is doing that is related to supporting performance on low-end hardware like that?
     
  42. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Would it be possible to have an option to set the color from the material directly?
     
  43. Vad3rInHale

    Vad3rInHale

    Joined:
    Apr 19, 2015
    Posts:
    96
    upload_2020-2-14_14-18-26.png Getting this. When there is detail meshes on the terrain, I hit play and they disappear. After I exit out of play, I get these messages
     
  44. Vad3rInHale

    Vad3rInHale

    Joined:
    Apr 19, 2015
    Posts:
    96
    upload_2020-2-14_17-11-56.png Have been getting these types of errors repeatedly today
     
  45. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    vanHalen17 I've also been getting those Null Reference errors. As you've stated they don't cause any real issues (compiler errors) or stop the project in any way. I'm guessing it's an issue with the new Unity version.

    For what it's worth I purchased both Nature Renderer and Open World Nature kit and I'm very happy with both purchases. I'm using HDRP so I had no option in Unity to use detailed grass and terrain features that I like. This package really does work as easy as it says it does, Install and paint with the default tools.

    There's a few issues here and there, mostly related to how Unity is constantly updating and changing everything. Also custom shaders aren't really compatible with HDRP as I've come to understand, so that adds to the difficulty of amking everything work. But this package works great and really makes your game look the way you'd expect it to and want it to. Plus the developer is constantly working at improving it and has very good response times when problems arise.
     
  46. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    64
    I am using the trial version for HDRP, but detail distance is locked to max 70. (Slider goes up to 350 but it does nothing).
    Is this a bug or trial limitation?
     
  47. Vad3rInHale

    Vad3rInHale

    Joined:
    Apr 19, 2015
    Posts:
    96
    Have you been able to get the HSV values from the OpenWorldNature/Grass shader to work? I've changed them, but I'm not getting any color changes
     
  48. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Version 1.1.7 is now available for download through the Package Manager and will be available on the Asset Store within the next few days. You can go to Help > Nature Renderer > Check for Updates to download the update.

    Changes:
    • New: Performance improvements.
    • New: Render buffers are now kept between frames and are only refreshed when visible details on the screen changed.
    • New: Rendering now uses multiple threads if available.
    • New: Camera culling mask is now applied to terrain and terrain details.
    • Changed: Terrain Details now use the color of the material if no Healthy or Dry color is set in the terrain detail settings.
    • Changed: Stream section in Nature Renderer component is now collapsed by default.
    • Changed: Grass and Vegetation shaders now also work when using a deferred renderer and are no longer forced to be rendered using a forward renderer.
    • Fixed: Issue where terrain details would not render in a build if there was no Global Wind component in the scene.
    • Fixed: Stream-out distance is now calculated correctly.
    • Fixed: Grayscale textures now work correctly as 2D grass textures.
    • Fixed: 2D Grass textures now work correctly in Universal Render Pipeline.
    • Fixed: Performance issues with streaming when using multiple cameras.
    • Fixed: Exception when removing a terrain detail from the terrain settings.

    @GarrettF This update should fix the CPU issues for you.
    @vanhalen17 This update should fix those exceptions you were getting. (Although they are safe to ignore). I have also updated the color behavior. Now it should be possible to change the color of terrain details in the material if no specific color is set in the terrain settings.
    @Lars-Steenhoff I have added the option to set the color in the material for you. Pleasedownload the update and give it a try.
     
    Neviah and Lars-Steenhoff like this.
  49. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The culling distance of the LOD Group on the terrain detail is used if it is lower than the Render Distance in the terrain settings. (https://support.visualdesigncafe.com/hc/en-us/articles/360000525201-Draw-Distance)
    That way you can set the culling distance for each terrain detail individually. Please modify the LOD Group if you need a larger culling distance.
     
    Neviah likes this.
  50. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Nice updates!
    And I'm looking forward to the instanced indirect update.