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. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    Any news about character collision ? ^^
     
  2. bartek0403

    bartek0403

    Joined:
    Mar 20, 2018
    Posts:
    7
    Is it possible to set up Nature Renderer with SRP Batcher? According to https://blogs.unity3d.com/2019/02/28/srp-batcher-speed-up-your-rendering/ I see that in my case, Nature Renderer increases time of Standard render path, genarating therefore cpu overhead, while build-in Unity Terrain detail system renders in Batcher patch and cpu render time is not noticeable.
     
  3. noriox

    noriox

    Joined:
    Feb 9, 2017
    Posts:
    1
    Does the latest version support Shader-based fading? I'm trying with URP, but I can't find any such settings.
     
  4. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    Anything happening with this lately?
     
  5. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It looks like the notifications from the forum were not coming through. Here is an update on the progress:

    I am currently working on a large update for the shaders, which adds much better compatibility with all Unity and SRP versions. This new version also paves the way for more features and faster updates.

    What is included:
    • Compatibility with all Unity versions from 2018.4 to 2020.1
    • Compatibility with all SRP versions from 2019.3 to 2020.1
    • Full support for Shader Graph for URP and HDRP. This allows you to edit/extend the shaders in shader graph.
    • Full HLSL support for Standard, URP, and HDRP. This allows you to edit the HLSL code directly (if you don't want to use Shader Graph)
    • Smooth fading out of grass in the shader for all render pipelines.
    • Translucency for all shaders and all render pipelines.
    • Shader-based color variations for all shaders
    • Multiple coloring methods (Tint or Hue/Saturation/Lightness coloring)
    • Better wind for all vegetation
    • The option to use either a Mask Map or Metallic/Gloss map.
    Besides the changes to the shaders, GPU Instanced Indirect is added as an experimental feature to Nature Renderer. This allows to draw all vegetation as a single batch (per object type), resulting in much better performance.

    This update is currently in the final stage of beta testing and should be available this month. If you want to give the beta a try then feel free to contact me.

    After this shader update is live, foliage interaction is next :)

    @GarrettF @noriox @r3ndesigner
     
    Mauri, hopeful and Lars-Steenhoff like this.
  6. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I'll take a look at SRP Batcher compatibility. I am not entirely sure if it has any effect combined with GPU Instancing, which is what Nature Renderer is based on. I'll get back to you when I have more info.
     
  7. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    Sounds exciting looking forward to it!
     
  8. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The latest version has just been submitted to the Asset Store and should be available within the next few days. Usually, the update is available through the built-in updater immediately, but this time it will be simultaneous with the Asset Store release due to the large changes. I want to make sure that the upgrade process is as smooth as possible for everyone :)

    I'll post here as soon as the update is live.
     
    Lars-Steenhoff likes this.
  9. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Nature Renderer version 1.2.0 is now available through the built-in updater and on the Asset Store. A lot of work has gone into this update, especially to create a workflow for the shaders that is compatible with a large range of Unity/SRP versions.

    I'll continue to improve the shader workflow and functionality over the next few updates. I am very much looking forward to feedback regarding the shaders.

    Important: After importing the update you will be asked to convert your materials from the legacy Open World Nature shaders to the new Nature Shaders. Make sure to upgrade them, as the old shaders are no longer supported.

    New:
    • Shaders are now compatible with all SRP 7.X versions.
    • Shaders now support both Mask Map and Metallic/Glossiness Map.
    • Color variation support.
    • Translucency support for all render pipelines.
    • Shader Graph support for URP and HDRP.
    • Shaders now support both Tint and HSL color correction.
    • All render pipelines now support and use billboard renderer.
    • GPU Instanced Indirect support as an experimental feature.
    Fixed:
    • Fixed crash when loading a large amount of terrains simultaneously in edit-mode.
    • Terrain details are now correctly refreshed if the terrain is moved.
    Changed:
    • Improved wind animations for shaders.
    • Healthy and Dry colors are now swapped to match with Unity’s coloring.
    • A warning is now shown if no ‘main-camera’ is set instead of an error.
    • Organized folder structure for better support when working with multiple render pipelines.
      Delete the previous package from your project before updating to get a correctly organized project.
    Removed:
    • Healthy and Dry colors for terrain details are no longer supported for materials that use HSL color correction. Materials should use Tint from now on, or the color variations should be set in the material instead of the detail settings.
    • Removed support for Lightweight Render Pipeline.
     
    Mauri, Lars-Steenhoff and hopeful like this.
  10. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    A bit more detail on the changes to the shaders:

    The shaders now ship as Shader Graphs with custom nodes to add more functionality. This allows you to edit the shaders using Shader Graph to fit your needs. It also makes sure that the shaders stay compatible with future Unity/SRP updates, because the shaders will be recompiled with new Shader Graph versions.

    The standard version of the shaders ships as a surface shader that relies on the same custom nodes as Shader Graph. You can edit the surface shaders using HLSL as well as the custom nodes.

    The following custom nodes were added to Shader Graph:

    Nature Shader Master Node
    There is a custom master node that adds additional functionality specifically for the nature shaders. It adds code and defines for specific object types (Plants, Grass, Tree Leaves, Tree Bark), code for translucency, support for Unity's Tree Creator, instancing support for Nature Renderer, and a custom material editor. Most of these settings are handling internally and change the behavior of the other nodes (such as wind animations).

    Wind
    The wind node computes wind animations for your object. It can be used for any shader, but it does rely on some specific data and properties.

    Billboard
    The billboard node adds support for billboards using Unity's Billboard Renderer.

    Perlin Noise
    A perlin noise generator. This node generates the exact same perlin noise as Unity's terrain system and the Mathf.PerlinNoise API.

    HSL
    Hue, Saturation, Lightness color correction. Similar to Unity's built-in nodes, except that this is combined in a single node.

    Fade Out
    A node to fade-out objects based on the distance from the camera. Will cull the object it is completely faded out. The fade is done by scaling down the object.


    There are a lot more nodes available that are currently for internal use only. I'll continue adding them over the next few updates, while implementing feedback on how these new nodes work. I'll continue to add more documentation as well.
     
    Lars-Steenhoff and hopeful like this.
  11. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Great update, I'm upgrading now

    And one general question; does nature renderer support the use of Amplify imposters?
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Just updated to the new version and all of the shaders under Nature Shaders>Standard have this error:
    I also can't build successfully and I keep getting the errors:
    I'm using Unity 2019.3.0f6 without HDRP or URP.
     
  13. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    Hey the update looks great and I'm excited for it. But just like BHS above me I'm also having troubles.

    I updated both nature renderer and open nature world package and some of the shaders are still giving errors. I can't have any trees or grass with the update and I also loose all of my prefabs and would have to rebuild everything I've made with nature renderer.

    I'm using HDRP 7.1.8 with unity 2019.3.0f6. I've tried updating onto my current project and I've also tried deleting the nature renderer folders and still end up with no working shaders and having to redo my terrains.

    I've reverted back to my previous version and it's working just as before, so I can still work on my project.

    Looking forward to getting the update working.
     
  14. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for reporting these issues. It looks like you exceeded the maximum number of shader keywords in your project. Can you try to import the attached shaders to see if they work? I have changed the keywords to local instead of global, which should help.

    You might have to reimport the project to fix some of the compile errors. Unity has some shader caching issues in the latest versions which only seem to be resolved by reimporting the entire project (Assets > Reimport All).

    As for the undeclared identifier 'UNITY_TRANSFER_LIGHTING' error: this is a very strange error that seems to pop up randomly. It comes from an internal Unity file and reimporting the shaders usually fixes the error. But I am still looking for a consistent way to reproduce and fix this error so that I can send a bug report to Unity.
    If reimporting does not work then please let me know, changing some shader-related project graphics settings should fix this issue as well, although I am still looking into it.
     

    Attached Files:

  15. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Can you let me know which errors in specific you are getting? If there is an error about the shader not being able to find a file then please try to reimport all assets (Assets > Reimport All). Unity/Shader Graph sometimes does not refresh the included files and ends up with the wrong files being cached.

    Also, can you elaborate on how you loose your prefabs? Are the references to the prefabs being lost?
     
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Update: Managed to find a temporary fix by changing #pragma target 4.0 to #pragma target 5.0 within the Nature Shaders/Grass shader.

    Thanks for getting back to me regarding this.

    I updated the shaders and reimported the entire project. It seems to have fixed the shader errors except for the Grass shader. I'm still having the following error on the Grass shader. Reimporting the Grass shader specifically gets rid of the error until I build and then this error reappears.

    I'm also still having the following build error:

     
    Last edited: Jun 1, 2020
  17. hepphep

    hepphep

    Joined:
    Feb 1, 2013
    Posts:
    24
    Hi, I upgraded Nature Render to latest version and got issues with building the project getting the following error during build. Tried to clean up Library folder to ensure there is nothing old conflicting, but it did not help.

    ArgumentException: The Assembly UnityEditor is referenced by VisualDesignCafe.Rendering.Nature.Editor ('Assets/Open World Nature/Plugins/com.VisualDesignCafe.NatureRenderer/VisualDesignCafe.Rendering.Nature.Editor.dll'). But the dll is not allowed to be included or could not be found.

    I'm using HDRP version.
     
  18. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Version 1.2.1 is now available through the built-in package manager. Go to Help > Nature Renderer > Check for Updates to download it. It will be available on the Asset Store within the next few days.

    In this version I have fixed the shader errors and build errors that were reported:

    New:
    • Nature Shaders version now shows in the material editor.
    • An error is now shown in the inspector when using legacy shaders.
    • A button is added to the inspector to upgrade legacy shaders.
    Fixed:
    • Fixed normal calculation in wind shader.
    • Material upgrader now correctly upgrades all properties.
    • Grass Textures now render correctly when using the new Nature Shaders.
    • Fixed incorrect plugin settings for VisualDesignCafe.Nature.Editor causing it to be included when building, resulting in a build error.
    Changed:
    • Shader keywords are now local for Unity 2019.1 and newer.
    • Shader target is now 4.5 to fix compile errors when building.

    Thanks a lot for reporting this. I looked into it, and setting the target to 4.5 fixes the error for all shaders. I have included it in the new update.

    Thank you for reporting this. It should be fixed in the latest update. (see above)
     
    hopeful likes this.
  19. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I have not tested Amplify Imposters in specific since I do not own it. If it relies solely on shaders then it will most likely work, if it requires scripts as well then I'll probably have to create a custom integration for it. I'll look into it.
     
  20. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,191
    Hi, I just purchased Open World Nature Kit, and as I could not find a forum dedicated to it, I'm posting here. I have and issue and a question (using Unity 2019.3.7f1, Universal RP 7.4.1, and ShaderGraph 7.4.1.)

    First, I am unable to open the shaders found in Visual Design Cafe->Nature Shaders->Universal; I get the following exception and a grey blank shader graph screen.

    Code (CSharp):
    1. Exception thrown while invoking [OnOpenAssetAttribute] method 'UnityEditor.ShaderGraph.ShaderGraphImporterEditor:OnOpenAsset (int,int)' : MissingMethodException: void UnityEditor.ShaderGraph.Drawing.PBRSettingsView..ctor(UnityEditor.ShaderGraph.PBRMasterNode)
    2. VisualDesignCafe.Nature.Editor.ShaderGraph.Universal.UniversalNatureShaderMasterNode.CreateCommonSettingsElement () (at C:/Visual Design Cafe/Projects/Nature Shaders/Unity/Nature Shaders URP/Assets/Nature Shaders/Plugins/Editor/VisualDesignCafe.Nature.Editor.ShaderGraph.Universal/Nodes/UniversalNatureShaderMasterNode.cs:131)
    3. UnityEditor.ShaderGraph.MasterNode.CreateSettingsElement () (at Library/PackageCache/com.unity.shadergraph@7.4.1/Editor/Data/Nodes/MasterNode.cs:53)
    4. UnityEditor.ShaderGraph.Drawing.MaterialNodeView.Initialize (UnityEditor.ShaderGraph.AbstractMaterialNode inNode, UnityEditor.ShaderGraph.Drawing.PreviewManager previewManager, UnityEditor.Experimental.GraphView.IEdgeConnectorListener connectorListener, UnityEditor.Experimental.GraphView.GraphView graphView) (at Library/PackageCache/com.unity.shadergraph@7.4.1/Editor/Drawing/Views/MaterialNodeView.cs:192)
    5. UnityEditor.ShaderGraph.Drawing.GraphEditorView.AddNode (UnityEditor.ShaderGraph.AbstractMaterialNode node) (at Library/PackageCache/com.unity.shadergraph@7.4.1/Editor/Drawing/Views/GraphEditorView.cs:753)
    6. UnityEditor.ShaderGraph.Drawing.GraphEditorView..ctor (UnityEditor.EditorWindow editorWindow, UnityEditor.ShaderGraph.GraphData graph, UnityEditor.Graphing.Util.MessageManager messageManager) (at Library/PackageCache/com.unity.shadergraph@7.4.1/Editor/Drawing/Views/GraphEditorView.cs:270)
    7. UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.Initialize (System.String assetGuid) (at Library/PackageCache/com.unity.shadergraph@7.4.1/Editor/Drawing/MaterialGraphEditWindow.cs:697)
    8. UnityEditor.ShaderGraph.ShaderGraphImporterEditor.ShowGraphEditWindow (System.String path) (at Library/PackageCache/com.unity.shadergraph@7.4.1/Editor/Importers/ShaderGraphImporterEditor.cs:50)
    9. UnityEditor.ShaderGraph.ShaderGraphImporterEditor.OnOpenAsset (System.Int32 instanceID, System.Int32 line) (at Library/PackageCache/com.unity.shadergraph@7.4.1/Editor/Importers/ShaderGraphImporterEditor.cs:59)
    10. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    I tested creating a new shader graph shader and it opened fine.

    Second, Is there any way to use instanced indirect with Vegetation Studio Pro with the Grass shader (and possibly other shaders)?
     
  21. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for reporting this issue. The support channel for Open World Nature Kit is mainly through email, but it is fine to post here since the shaders are included in both assets.
    It looks like Unity changed some type names in the latest version of URP (7.4.1), resulting in this error. I have fixed it and will publish a new version today or tomorrow.
     
    gilley033 likes this.
  22. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    An update to the shaders is now available that makes the shaders compatible with Universal Render Pipeline 7.4.1. You can download the update by going to Help > Nature Renderer > Check for Updates or Help > Open World Nature > Check for Updates. The update also comes with a few additional small fixes and changes.
    The shaders can be downloaded as a separate package called Nature Shaders in our package manager.

    Edit: To clarify: Unity 2019.4 Standard Render Pipeline and HDRP 7.4.1 have been verified as well.

    A new release for Nature Renderer is also almost ready (version 1.3.0). The new version contains a large update to the rendering system and includes a fully featured Procedural Instancing/GPU Instanced Indirect feature. The update will give your project a huge performance boost. It will be available next week.

    (@gilley033 )
     
    Lars-Steenhoff likes this.
  23. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,191
    Thanks for the speedy update! There was an "Invalid Node Type" error in the console after importing but the graph is working great so it doesn't appear to be a problem.
     
  24. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It seems to be an addition by Unity but should be safe to ignore. It is because we use custom nodes in the graph. Glad to hear that everything is working now.
     
  25. gdespaux2010

    gdespaux2010

    Joined:
    Feb 16, 2017
    Posts:
    34
    Is there anything specific that needs to be done to remove NR and re-enable the normal terrain grass rendering? I now have an issue where NR will render my grass, but disabling it/removing the component leaves my terrain empty. I did manually change the Terrain's draw distance back to something above 0, and tried painting more details, but nothing appears. Adding the NR component again renders my grass. What can I do?
     
  26. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Just removing Nature Renderer should be enough. However, if you use prefabs for terrain details then you'll have to make sure that the prefabs you use are supported by Unity. Unity's renderer only supports prefabs with a single Mesh Renderer on the prefab root. Any other structure (such as LOD Groups or multiple renderers) do not work.

    Is there any specific reason why you want to remove Nature Renderer?
     
  27. gdespaux2010

    gdespaux2010

    Joined:
    Feb 16, 2017
    Posts:
    34
    The asset is great, I was only removing it temporarily because it seemed to cause some sort of issue with Gaia 2 spawners. I'm still not sure if the issue is with Unity, Gaia, or NR, or just something I've set in my project. But toggling NR off and on again seems to clear it up.

    You're right, the prefabs I'm using aren't supported by the normal terrain renderer, that's why they weren't showing up when NR was removed. Thanks for clearing that up for me! :)
     
    Visual-Design-Cafe likes this.
  28. gdespaux2010

    gdespaux2010

    Joined:
    Feb 16, 2017
    Posts:
    34
    Are we/will we be able to specify some random/noise-based y rotation for terrain details? Something to help break the visual repetition?
     
  29. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Nature Renderer version 1.3.0 is now available through the built-in updater. Go to Help > Nature Renderer > Check for Updates to download it. It will be available on the Asset Store within the next few days.

    This update has been in development for months and I am very excited to finally publish it. The main new feature is full Procedural Instancing support. This means that the entire render pipeline is now handled on the GPU using compute shaders. The result is a massive performance boost. Compared to the previous version you can get around 10X performance. I have also done a quick performance comparison with Vegetation Studio, and Nature Renderer is about 30% faster than Vegetation Studio now (and even more in edit-mode).

    Quite a few things have changed internally for the new rendering system, so if you notice something that is not working as expected then please do not hesitate to contact me.

    Here is the full changelog:

    New:
    • Procedural Instancing is now fully supported and enabled by default. This new feature allows the entire render pipeline to be handled on the GPU using compute shaders, resulting in a massive performance boost.
    • It is now possible to reduce detail density for details that are further away from the camera.
    Fixed:
    • Terrain Details are no longer rendered for preview cameras.
    • Fixed issue where terrain details would not be removed when erasing them.
    • Fixed issue where terrain details would not have the correct position compared to the area that was painted.
    • Fixed issue where terrain details would not update correctly when changing the density in the terrain settings.
    • Fixed issue where terrain details would not update correctly when changing the color or size in the detail settings.
    • Fixed MissingMethodException in Universal Render Pipeline 7.4.1.
    Changed:
    • Nature Renderer version now shows in the inspector.
    • Added ‘troubleshooting’ button to the inspector to open the troubleshooting section of the documentation.
    • Improved cell streaming performance.
    • Improved inspector performance.
    • Increased internal cell size.
    • Reduced garbage collection when streaming in new terrain details.
    • Improved debug section of Nature Renderer component.
    • Improved performance when painting terrain details.
    • All shader keywords are now local by default.
    • Changed shader target to 4.0.
    • More internal stability and performance improvements
     
  30. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Please give the latest version a try. I have improved some caching behavior, it might fix it.

    All detail objects should have a random Y-rotation already. If your objects do not have a random rotation then please let me know. Or do you want to add a random X and Z rotation as well? (It shouldn't be too hard to add)
     
    gdespaux2010 likes this.
  31. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    Good job with this update!

    I'm trying to make the procedural instancing work but I use The Vegetation Engine's shader for 100% of my vegetation and I can't seems to make it work. I have some alerts the terrain (on all the vegetation I tested) saying that it is not supported. Is there something I can do on my end to fix this?

    upload_2020-6-20_12-14-52.png
     
  32. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The shaders need to be modified a bit because the GPU renderer directly connects to the shaders. The procedural instancing data is passed directly to the shader, so the shader needs to know how to process that data. I have just put together a guide on how to edit your shaders for this:
    https://support.visualdesigncafe.co...rocedural-Instancing-support-to-custom-shader

    You'll just need to edit 3 lines of code.

    I'll contact the developer of The Vegetation Engine as well to see if Nature Renderer can be supported by default.
     
    Lars-Steenhoff likes this.
  33. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    Awesome, thank you for the document! I will try this today.
     
  34. gdespaux2010

    gdespaux2010

    Joined:
    Feb 16, 2017
    Posts:
    34
    I started getting this after the 1.3.0 update. I have Procedural Instancing disabled, as it doesn't support the shaders I'm using (Stylized Grass by Staggart Creations)


    Code (csharp):
    1. ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    2. Parameter name: destinationOffset
    3. VisualDesignCafe.Pooling.ArrayExtensions.CopyToFast[T] (T[] source, System.Int32 sourceOffset, T[] destination, System.Int32 destinationOffset, System.Int32 count) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Pooling/ArrayExtensions.cs:98)
    4. VisualDesignCafe.Pooling.ArrayExtensions.Copy[T] (T[] source, System.Int32 sourceOffset, T[] destination, System.Int32 destinationOffset, System.Int32 count) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Pooling/ArrayExtensions.cs:50)
    5. VisualDesignCafe.Pooling.ArrayExtensions.Resize[T] (T[]& array, System.Int32 size, VisualDesignCafe.Pooling.ArrayPool pool) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Pooling/ArrayExtensions.cs:33)
    6. VisualDesignCafe.Rendering.Nature.DetailLayer.AddInstances (VisualDesignCafe.Rendering.Nature.PlacementAlgorithm+InstanceData[] instances, System.Int32 count) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Data/DetailLayer.cs:177)
    7. VisualDesignCafe.Rendering.Nature.PlacementAlgorithm.Place (VisualDesignCafe.Rendering.Nature.DetailLayer detailLayer, UnityEngine.Rect pixelRect, UnityEngine.Bounds localBounds, System.Single density, System.Int32[,] detailTexture, System.Int32 layer, System.Single& minHeight, System.Single& maxHeight) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/PlacementAlgorithm.cs:145)
    8. VisualDesignCafe.Rendering.Nature.Cell.BuildDetailLayer (System.Int32[,] detailTexture, UnityEngine.Rect pixelRange, System.Int32 layer, System.Single density, System.Single& minHeight, System.Single& maxHeight) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/Cell.cs:303)
    9. VisualDesignCafe.Rendering.Nature.Cell.Build (System.Int32[,][] detailTextures, System.Boolean[] dirtyLayers, System.Single density) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/Cell.cs:225)
    10. VisualDesignCafe.Rendering.Nature.BuildQueue.RebuildCellIfChanged (VisualDesignCafe.Rendering.Nature.BuildQueue+CellBuildData cell) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/BuildQueue.cs:273)
    11. VisualDesignCafe.Rendering.Nature.BuildQueue.BuildNext () (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/BuildQueue.cs:238)
    12. UnityEngine.Debug:LogException(Exception)
    13. VisualDesignCafe.Rendering.Nature.BuildQueue:BuildNext() (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/BuildQueue.cs:258)
    14. VisualDesignCafe.Rendering.Nature.BuildQueue:BuildAll(Action`1, Int32) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/BuildQueue.cs:214)
    15. VisualDesignCafe.Rendering.Nature.<>c__DisplayClass22_1:<Build>b__1(Object) (at C:/Visual Design Cafe/Projects/Nature Renderer/Unity/Nature Renderer URP/Assets/Visual Design Cafe/Plugins/com.VisualDesignCafe.NatureRenderer/Runtime/VisualDesignCafe.Rendering.Nature/Build/BuildQueue.cs:201)
    16. System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
    It seems to cause large squares of terrain details to not render at particular LOD distance. If I see a blank patch on the terrain and run over to it, it will suddenly pop in once I'm on top of it. This happens in scene view, game view, and in actual builds.
     
  35. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Waiting for the e-mail for the free trial, but have to get to bed anyway, thought I'd ask. Do you have any users using this with procedural runtime content? I see "Procedural Instancing" mentioned, I hope it's something along those lines. I don't have any pre-generated content, most vegetation systems have a steep startup preparing cell structures and array and things, which makes them unusable for me, constantly generating new terrains.
     
  36. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for reporting this. It is an issue when loading the terrain details for a specific LOD in a cell, so they are not added to the renderer (and don't render as a result). I can't reproduce the issue here but found a possible cause and fixed it. I'll send you a new build so that you can give it a try.
     
    gdespaux2010 likes this.
  37. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Yes, some users are using Nature Renderer with procedural content. Nature Renderer also needs to build cell structures and arrays, but it is done on a background thread and requires very little resources. It should be no problem at all to generate new terrains and then stream-in the terrain details for them. There are two things to take note of:

    1. Nature Renderer needs a bit of time when first loading the terrain, only if the terrain is in rendering range. This is no problem when loading in additional terrains later, just the first one immediately after spawning.

    2. The biggest performance hit is loading the terrain data from Unity. I recommend to split your terrains up in smaller sizes (small detail resolution and heightmap resolution in specific) to improve loading times. Unity does not provide any async way of loading the terrain data, so you can see some performance spikes if the terrain is very large.
     
  38. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
  39. gdespaux2010

    gdespaux2010

    Joined:
    Feb 16, 2017
    Posts:
    34
    If anyone is using the Stylized Grass Shader from Staggart Creations, you can easily convert them to work with Procedural Instancing. In the StylizedGrassShader.shader:

    Add

    "NatureRendererInstancing" = "True"


    in the "Tags" section of your shader, near the top.

    Then change all instances of


    #include "Libraries/VS_InstancedIndirect.cginc"
    #pragma instancing_options renderinglayer procedural:setup


    with


    #include "Assets/Visual Design Cafe/Nature Shaders/Common/Nodes/Integrations/Nature Renderer.cginc"
    #pragma instancing_options procedural:SetupNatureRenderer


    The multi_compile_instancing keyword is already there.
    Of course, if your NatureRenderer.cginc file is somewhere else, please use that path instead.

    Thanks to Staggart Creations for guiding me on how to change it!
     
    Last edited: Jun 24, 2020
  40. GarrettF

    GarrettF

    Joined:
    Jul 4, 2019
    Posts:
    49
    Hi, sorry I couldnt get back to you in good time. Haven't had a lot of time to try to fix bugs lately. But today I opened a new project in 2019.3.6f1, HDRP template. I imported both Nature Renderer and Open World Nature kit and opened the HD packages and imported them as well.

    I am now getting a bunch of errors and I can't use any grass or terrain details

    I've included a screen shot of the console with all the errors. Let me know what else I can do.
     

    Attached Files:

  41. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Assets/Reimport All should fix the issue. Shader Graph has some serious caching issues and often can't find any of the include files. Reimporting the plugins and Shader Graph sometimes works, but often you have to reimport the entire project to clear whatever cache Unity is keeping for them.
     
  42. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    That should work indeed, thanks for posting. Don't forget to add the "NatureRendererInstancing" = "True" tag so that the feature will be enabled in Nature Renderer :)
     
    gdespaux2010 likes this.
  43. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    A quick notice for everyone:
    If you are using Procedural Instancing with the Univeral Render Pipeline then you'll get a warning at runtime that the shaders do not support Procedural Instancing. This is a known issue and it is because Unity can't find the "NatureRendererInstancing" shader tag, only at runtime and in URP in specific (one of the mysteries of Unity).
    It is not an issue with your shaders and if it works in edit-mode then everything should be fine, there is no need to change anything. An update will be live in the next few days with a fix for this and then procedural instancing will be enabled at runtime as well.
     
    Last edited: Jun 24, 2020
  44. gdespaux2010

    gdespaux2010

    Joined:
    Feb 16, 2017
    Posts:
    34
    Thanks, edited to include that!

    I do have this issue and am using URP, but it seems it does disable Procedural Instancing at runtime. I have a massive FPS gain in Edit Mode, but once I enter Play Mode the FPS is the same as it is without PI enabled.

    Edit: Just received your email. I'll wait for the next update with the fix, thanks! Just leaving this here for anyone else searching the forums!
     
  45. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    It seems to work great but I think there is a bug. Performance are way higher when you are on the NR script (on the terrain) and open the debug.
    Having open allow me to go from 60 fps to 160 somehow.
    Once the project is built, I tend to go below 60.

    upload_2020-6-24_17-34-14.png

    upload_2020-6-24_17-34-51.png
     
  46. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Can you try this when measuring with an fps counter and let me know if you are seeing the same results? The statistics in Unity don't always show accurate results and the Unity Editor itself tends to influence the stats. In this case, when the debug section is open the editor is forced to repaint every frame which can influence the results.
     
  47. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Version 1.3.1 is now available through the built-in package manager and will be available on the Asset Store within the next few days. Go to Help > Nature Renderer > Check for Updates to download the update.

    This version is a stability and quality of life update. It fixes all known issues, has more helpful warning/error messages if any settings are wrong, and improves caching/refreshing of details when you edit them (painting/erasing/changing settings). I have also verified compatibility with Gaia and Map Magic.

    Here is the full changelog:

    New:
    • Full support for Gaia 2.
    • Full support for Map Magic 1 and 2.
    • It is now possible to set the shadow casting mode for 2D grass textures.
    Fixed:
    • Procedural Instancing now works correctly for Universal Render Pipeline at runtime.
    • Fixed issue where ‘reduce density in distance’ would produce incorrect results if the terrain was moved.
    • Fixed memory leak of internal materials.
    • Fixed issue where terrain details would not show immediately for the first added detail prototype.
    • Fixed ArgumentOutOfRangeException when streaming in cells.
    Changed:
    • Improved error and warning messages for invalid detail settings.
    • Improved stability and error handling.
    • Improved refreshing of terrain details when painting details or heightmap.
    • Improved refreshing of terrain details when adjusting settings.

    (@gdespaux2010 URP should work now at runtime)
     
  48. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    I have tried the tool ad indeed the difference between Unity and fps counter is huge. Everything work great thanks!
     
  49. Sheprekt

    Sheprekt

    Joined:
    Dec 11, 2017
    Posts:
    9
    Hi! I'm enjoying using Nature Renderer, but I feel as though I'm making some mistakes somewhere because there's a huge FPS deficit.

    This is my scene without grass https://i.imgur.com/lQQ1mKD.jpg (~150fps)
    This is my scene with grass https://i.imgur.com/vIvV1s8.jpg (~90fps)

    I'm still in the early phase of my project, so I'm trying out what tools and processes to use. I understand there will be a performance hit when adding things like grass, but a 60fps drop is much more than I expected - and I want to leave as much FPS budget as possible for other things, for example there isn't much going on in this scene.

    In essence, I'm wondering if I might have just configured some things wrong - and there's a way to claim some of these frames back. I'm using the URP, 2020.1 beta. This is a 2D texture grass. It's not particularly "full" either, filling out the grass more has a stronger degradation in frames. Shadows are set to "On", and all pipeline settings are default. I've also set the render distance to cull just outside of the camera angle here.

    Please let me know if there's anything obvious I should try here. To me, 2D grass like this probably shouldn't have such a claim on performance - and while 90fps isn't drastically bad, it only leaves me a budget of around 30 for things that actually matter.. Thanks in advance!

    Edit: I took the same scene and just disabled Nature Renderer. It looks ugly with Unity's default grass but it rendered at ~120fps. I'm definitely doing something wrong, right?
     
    Last edited: Jun 29, 2020
  50. gdespaux2010

    gdespaux2010

    Joined:
    Feb 16, 2017
    Posts:
    34
    Are you using Procedural Instancing? If not, the grass is going to render using your CPU, so the FPS will fluctuate wildly. Also make sure you don't have the grass too thick anywhere. Depending on how it's placed and how the prefab is made, it's possible to have lots of overlapping grass which kills the framerate but doesn't make the game look any better.