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

Hi,

I am having an issue with grass lighting in HDRP version 7.3.1 using Nature Renderer 1.3.10.

Please see this post for details: Grass lighting in HDRP - Unity Engine - Unity Discussions .

Thanks in advance!

Hi, i had 2 issues, solved 1, and now only one remains :slight_smile:

  1. When using URP/Nature shaders/Grass i get an error in console:
    "Material doesn’t have a texture property ‘_MainTex’

My setup: Windows, Unity 2020.1.10, URP, MapMagic

Thank you!

Hello, could you please add an option to disable the package manager auto functionality? Having it popup every day to let me know that I should update or that I’m up to date is an annoyance I could really do without.

Produces GC every frame in the editor. EditorUserBuildSettings type can be cached…

This is most likely the specular reflection of the material.

Based on your screenshot I am assuming that you added a 2D Grass Texture (and not a prefab) for the grass. When using only a grass texture, a default mesh and material is created. The default mesh uses normals that are pointing up, and the default material has a smoothness value of 0.15 which shows a bit of specular reflection. The combination of those two will result in this effect.

What you can do is:

  • Create a new material in your project, and select the "HDRP/Nature Shaders/Grass shader" for it.
  • Assign this new material to the Material Override field in the Nature Renderer component. This will ensure that the material is used for all 2D Grass Textures.
  • Set the “Glossiness” value of the material to 0. Setting the value to 0 will remove most of this effect.

You will still see a bit of a highlight. This highlight is part of the lighting model of HDRP, and still shows because the normals of the mesh are pointing up. To “fix” this you will need a custom mesh with normals that are pointing forward.

If you do not have any 3D model for grass and you have no experience with creating 3D models then feel free to let me know. I can create a simple grass model for you and send it.

1 Like

You should be able to safely ignore this error. It is caused by an internal bug in Unity and should not have any effect on your project.

If having this error in your console is causing any kind of problem with your build pipeline or project then please let me know and I can send you a modified version of the shader to hide this error.

I’ll see if I can add it for the next update.
It shouldn’t pop up every day though, so there might be an update stuck in the queue.
You can delete the file “Library/com.VisualDesignCafe.PackageManager.queue-install.json” to clear the queue. That should usually get rid of the popup. (The “Library” folder is in your project root, and not within the Assets folder)

You are right, thank you for pointing this out. Looks like I missed caching one type. I’ll fix it for the next update.
It only happens in the editor though, so it should not have any impact on the performance in a build.

1 Like

I just upgraded Nature Renderer from sub 1.3 version, for additional performance improvements, and where I was using ‘custom provided’ light probes - but I can’t seem to get this to work again in the new version (I read you can’t do procedural instancing and light probes, but I’d like to do the old CPU way). Have you checked this recently or have it working? Thanks :slight_smile:

I just double checked it for you, and the light probes system is forced to be disabled in the 1.3.x updates. The system is still fully functional though, and it was just the setting that was not converted correctly from 1.2.x to 1.3.x. I’ll enable the system again for the next update, which should be available after the weekend.

1 Like

More GC in build. This is with deep profile enabled.

Nature Renderer version 1.3.11 is now available through the built-in updater, and will be on the Asset Store within the next few days. Go to Help > Nature Renderer > Check for Updates to download it.

New:

  • An error is now shown in the Nature Renderer component if one of the shaders used by detail objects has a shader compile error.

  • It is now possible to choose how mesh normals for 2D grass textures are generated (either pointing up or double-sided). ( @AndorfTheWhite Using double-sided normals should fix the lighting issue that you were having)

  • Nature Shaders: It is now possible to completely disable Wind and Translucency. This improves performance if the features are unused.

  • Nature Shaders: It is now possible to flip normals for backfaces.

  • Nature Shaders: Recalculating normals with wind animations can now be controlled with the “Recalculate Normals” field.

Fixed:

  • Fixed ThreadAbortException that could occasionally happen when editing.
  • Fixed issue where distance culling would not work correctly when using third-party shaders and caused objects to pop-in in chunks.
  • Fixed light probe sampling. ( @Vad3rInHale )
  • Fixed GC allocations for a few internal properties. ( @MrCool92 both have been fixed. Thank you for reporting them.)

Changed:

  • Streaming settings can now be changed through code.

  • Nature Shaders: Renamed “Vertex” wind control method to “Automatic”.

  • Nature Shaders: Moved “Object Height” and “Object Radius” fields to below the Wind Control field.

  • Nature Shaders: Moved “Fade Out” to transparency section, and “Fade Out Wind” to wind section.

  • Nature Shaders: Reduced the total number of shader variants used by the shaders to improve import and build time.

Removed:

  • Nature Shaders: Removed “UV” wind control method.
6 Likes

Thanks a lot, this does the trick!
No need for you to make a grass 3D model, thanks anyway

I’ll try using the functionality in the new update :slight_smile:

1 Like

thanks for the update!

I am still having some GC allocs…

when I get near the terrain


and when I fly around the terrain from time to time

1 Like

These ones are expected and are by design. If you move around the terrain then new details get streamed-in and placed. If the new details don’t fit in the existing internal memory pool then the pool is expanded and some new memory is allocated. This memory pool is managed by Nature Renderer, and is not released by the Garbage Collector, so it should not have any impact on performance for your project.

Hello,
I am using The Vegetation Engine in conjunction with Nature renderer and I have a couple of questions regarding the asset and how it works in a bigger scene(1500x1500 in my example). (Open world)

So, the first issue is, that I am getting over 700mb of pooled memory and a stuttery scene when I try to fly around the scene at a higher speed. (It’s the same in the built version of the project.) This might be connected to what MrCool92 said.
The second issue is that when I try to paint the Grass mesh (that has been converted by TVE asset) on terrain, I get this strange artifact where I don’t see anything painted on the terrain, only one mesh that is enlarged and is sitting on top of the view camera. (1. Picture)This has been an issue from before and might be connected to material or something different. Keep in mind that I tried to paint the same converted mesh on a different project and there it works.

My questions are.

What setup or changes do I need to do in regard to the first issue. Is it normal that when you fly around fast in a game you load chunks faster and the result is low frame rates or stutters until it loads the chunks? Is it possible to preallocate pooled memory?

Are TVE assets compatible with that in situations like an open world where you have to draw more than 20 different details on a terrain?

How big of terrain does this asset support and how complex this terrain can be in regards to the number of different details (or trees)?

The terrain has also Microsplat on it, does that affect it in any way?

Lastly, can this support multiple terrains being loaded without having any frame drops, lets say, that it works the same stable way as one big terrain?

This large frame rate drop wasn’t an issue in the older version of Nature Renderer. It only occurred after updating it and updating TVE.

I would like to know this as well.

+1 on this one. It is an issue which seems to have affected us as well. Hope @Visual-Design-Cafe chimes in.

When flying around the terrain Nature Renderer streams-in new detail objects. How fast they are loaded and the impact on performance depends on your terrain. The more detail objects you have, the longer it takes to load, and the bigger impact on performance you will get. And the faster you move around, the faster detail objects need to be loaded (thus, causing stuttering if too much needs to be loaded at once).

What you can do to improve this:

  • Disable streaming so that all detail objects are loaded at startup. (Only suitable for small terrains since it takes a lot of memory.)
  • Open the “Streaming” section and reduce the Stream Processor Limit. This will reduce the amount of processors that are used to stream-in data. Note that this will increase the overall load time, but reduces stuttering. You should only do this if the details are loading in fast enough, and stuttering is the only problem.
  • The best solution is to reduce the total number of objects on the terrain. And the best way to achieve this is by editing your meshes and merging individual grass objects (left in screenshot below) into a grass patch (right in screenshot).
    This will reduce the total number of objects while keeping the same density. Just merging 3 or 4 objects into a small patch will already speed up loading by 3 to 4 times (and reduce memory usage by 3 to 4 times).
  • I can recommend this for everyone, even if you don’t have specific performance issues. Because it is just a great way to speed things up.*
    6516245--734696--merged-meshes-into-grass-patch.jpg

Yes, TVE assets are compatible. But it is not guaranteed that all features are working perfectly. It depends on the developer of TVE if everything is implemented.
If you have any issues then I recommend to temporarily change the shader to "Nature Shaders/Grass" to check if it is a compatibility issue. If the Nature Shaders/Grass is working, then it is a TVE-specific issue. If it also doesn’t work with “Nature Shaders/Grass” then it is a bug in Nature Renderer (please report it if this is the case).

The recommended maximum size of a single terrain is 4096x4096. There is no limit on how many terrains you can have, and no limit on the amount of different detail objects/trees. The main concern will be memory usage, so it is best to keep an eye on the memory and find a good balance between memory usage and total number of different objects.

No, that should have no influence.

Yes, multiple terrains is recommended and is usually faster than one big terrain. Having multiple terrains usually saves a lot of memory usage.

Which specific version were you using before? I don’t recall changing anything that affects the frame rate this much, but I’ll double check the change logs for you.

(Edit: @razamgar @Muravu Just tagging you as well so you get a notification)

2 Likes

Hey, there a forum for nature Renderer. I wonder how did I miss it :expressionless:

@MatkoSimecki Hi, I’m Cristi, the TVE dev. I just checked NR + TVE + HDRP + 2020.1.12 and on my end, I have roughly the same framerate. Could you share your render pipeline, unity version, platform, etc?

NR

TVE

Cheers!

1 Like