Does Nanite Foliage Perform Well in UE5.1?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello fellow Unreal Engine developers and designers as you know Unreal Engine 5.1 came out a couple of months ago and I've been dying to see if nanite enabled foliage offers a better performance improvements so in today's video I'm going to look at regular foliage and nanite enabled foliage I'm going to do it for a grass scene and a trees heavy scene and we'll see if there's any difference let's get straight into it [Music] so I'm a little late to the party talking about nanite foliage as I said the 5.1 release came out a couple of months ago but I've been traveling through most of December so I didn't get around to doing this video until now so before we get into benchmarking the differences between regular foliage and nanite foliage I want to talk about the setup for these tests so I've got a couple of scenes I'm going to use from previous videos this one is my Glacier Valley and that's mainly grass and then I'm going to use the Arctic Forest which is mainly trees in some later tests and in terms of the setup I've got the standard out of the box project setup here so I'm using Lumen nanite and importantly I'm using virtual Shadow Maps virtual Shadow maps are really really look good on sort of realistic Maps I'll show you the difference between the two to so I'm going to also just to let you know I'm going to be running an epic settings if I look at the scalability running an epic I'm also going to make sure the screen percentage is full 100 for maximum Fidelity and let me just show you the difference between virtual Shadow maps and regular Shadow Maps so if I go into the project settings here and search for shadow virtual Shadow maps are on by default if you look at particularly in the front here where the foliage is if I change it to regular Shadow Maps you see it becomes this sort of soft um Quality here it's not quite as realistic you'll notice if I switch back particularly underneath the ground and in between the leaves you get much much more detailed Shadows which look much more realistic um so that's great but unfortunately it comes with a performance cost as well the main reason for that which I'll show you is if you look at the virtual Shadow map cached Pages you can see that where it's green here it's not having to recalculate the Shadows each frame but here in the foreground because the grass is moving there's got it's got a world position offset function in the materials which creates the slight wind movement it means that it invalidates the shadows in every frame that have to be recalculated now if you really need performance you can remove the movement but in my opinion uh static grass or static trees tend not to look as authentic so again let's bear that in mind when we do the tests so as I said we've got epic settings we have a hundred percent screen percentage or a hundred percent screen percentage and we have virtual Shadow Maps uh nanite and Lumen switched on although we're not using nanite at the moment so let's get into the first set of tests okay for my first test I'm going to use the regular foliage and I'm going to have two camera positions one with substantially more grass than the other um and I'm going to go into uh full screen well actually I'll put on the frame rate first so Ctrl shift H will show me my frame rate I'll go into full screen mode with f11 and then I'll go into play mode so you can see here that I'm getting around about 83 84 frames per second with this View if I then come out of play mode and I'll switch my bookmark to a view with much more foliage and go into play mode and you can see there that the frame rate has come down a lot simply because there's about double the foliage in the viewport so we'll make a note of those two versions and then we'll be able to compare those with the nanite enabled foliage at a moment now another thing I'm going to try um is that if you've seen one of my earlier videos on Virtual Shadow Maps you saw that for non-nanite foliage there was this console command that increased the performance of the Shadows Without Really changing the visual Fidelity too much it was this include in course Pages console commands I'm going to try that let's go back to bookmark one and if I go to console commands it was this one here r.shadow.virtual.nonite dot including course Pages zero so if I execute that and then go into full screen mode and play mode interestingly there isn't any difference the eight it was 84 frames per second before this command 84 frames per second so I'm wondering if they have now enabled that by default for non-nanite foliage in the projects so that used to be a way of improving the performance of the foliage and it seems to be enabled by default in the engine so that's a good thing I think but it'll be interesting to compare that with the frame rate when we've got the nanite foliage which doesn't take advantage of that command so let's now look at the nanite version of foliage and then we'll compare these frame rates all right so now we're going to convert our foliage to nanite and then do the same benchmarks and then we can compare them so I've got two grass Types on my landscape here if I go into my grass meshes I will change both of these so this is the first one so what I'm going to do is enable nanite support and preserve area The Preserve area you might have seen in other videos it just makes sure that the foliage and the leaves around the edges works properly especially for distant items so let's save that one and then also the other ones down here same thing enable nanite support preserve area save okay and sometimes I don't know if you'll get this or not sometimes I've noticed that it doesn't refresh straight away here so the easiest way for this is to go into one of the assets or the landscape grass type and just change an element and then re-save it and that seems to refresh everything here so that now it's been redone here so uh visually it looks the same to my eyes so even though it's now nanite foliage in fact we can check its nanite foliage if we go into the nanite visualization triangles you can see here that the foliage here is showing up on the nanite visualization so that's definitely nanite now so let's do the same benchmarks again for that two Benchmark for our two bookmarks so start off here go into immersive mode and play mode and make a note of the frames per second and then we'll come out of here go to Benchmark bookmark two with more foliage go into play mode and we will make a note of the frame rate there as well and now what we'll do is we'll look at a comparison between those two and see if there's any improvements in the performance so here are the benchmarks and they make a very interesting reading so the the first camera bookmark where I had less foliage on the screen the non-manite foliage I was getting 84 frames per second and then when I nanite enabled it it went down to 69 frames per second but then in the second camera Viewpoint where I had more grass on screen they were about same so the non-nanite was 45 and the nanite was about 45 46 so identical so that's got me thinking if I add more grass on the scene will the non-nanite one come down more and the nanite one actually improve over the um over the non-nanite so let's do another test in that scene and see if that's the case so I'm back in my Unreal Engine project and what I'm going to do is for the main graph type I'm going to increase the call distance so that it stretches further into the distance so if I go into the landscape grass type at the moment it's got a cold distance of 20 000 units so I'm going to change that to 30 000 to give me 50 more grass and save that and you can see that it's gone further up the hill here and what I'll do now I'll just save that and I will do a benchmark once it's reset the project there we go I'll do benchmarks for nanite and non-nanite and then we'll have a look at them in the table so I'll be back in a second so as you can see it's very interesting as I added more foliage onto the view the non-nanite grass performed worse so it went down to 26 frames per second whereas the nanite enabled foliage with even more foliage on the screen went down less so it stayed at 36 so quite a big Improvement of the non-nano foliage so my my supposition that it would scale better in nanite was correct so it's interesting you there's obviously a sweet spot here where it's the same but then if you've got a scene with lots of foliage on it you obviously want to do these benchmarks and the nanite enable foliage definitely improves better and if you're thinking well 36 frames per second is terrible don't forget you can then adjust things like the um the screen percentage and the TSR settings to increase the performance to a a good rate for your game player so you can still you can still adjust it but now it's going to give you better performance right out of the box so interesting first set of benchmarks certainly the the interesting things here is the course Pages Hack That I Used to do doesn't seem to need to be applied anymore for non-nanite and nanite just seems to scale better as you get more items on the screen so it's going to be interesting to do the next set of tests with the trees in my arctic Forest because I've got a lot of them on screen at any point in time so it implies that the nanite version because there's lots of trees should perform better so let's jump in there now and see if that's the case so I've loaded up my arctic forest scene and this is all trees in the foliage and I've set up a couple of bookmarks here so the first one is in my campsite so there aren't as many trees around because we're in the sort of depths of the forest and then the other bookmark is on top of a ridge where there is a forest as far as the eye can see so that should be a lower frame rate so as before what I'm going to do is I'm going to first of all check it out with this non-nanite foliage so again let me just check that the settings are uh epic settings and I've got the screen percentage at 100. uh let's put the frame rate on with Ctrl shift h switch to my other bookmark all right and let's start off full screen mode with f11 go into play mode and then you can see there I'm getting about 47 frames frames per second let's now come out of play mode switch to the other bookmark go into play mode and I'm getting about 60 frames per second here so that in itself is quite interesting because I thought that this would be a lower performance because of the fact that I've got more trees in front of me but I guess the other scene inside the campsite had more trees around me so the amount of processing for the tree foliage was greater in that instance okay let's now do the nanite version so if we go into the meshes so I found it here it was the Spruce half 03 that I was using if I open that up and I want to enable nanite support preserve area let's click save on that and it'll do a little bit of processing first and it'll also take a little bit of time just to recompile the shaders and now the shaders have compiled everything looks the same which is good so let's do the same benchmarks again so let me switch to the campsite View go into full screen play mode and the frame rate there is about 46 45 46 frames per second and then if I switch over to the other bookmark go into play mode and frame rate there is around about 51.52 frames per second so let's compare that in the table and we'll see if we can do a summary for this as well so here are the results from the Arctic forests test so when I was in the campsite view the non-nanite and nanite frame rates were broadly similar so there was uh there were more trees in the Viewpoint viewport and greater detail which required because we were closer up to them and then on the ridge where we had a view over the forest it was uh better in the non-nanite view than the nanite view but this is similar to the previous scene with the Glacier Valley so I suspect again if we were if we had denser Trees close up then I think nanite would win out on that in terms of drawing more quickly I could do another I'll do another test offline to see if that's the case but I'm pretty sure that will be the uh the end result so um it's only semi-scientific these benchmarks it was just really a test for my own edification but I think you definitely want to do some comparisons between the two my takeaway from this would be if you have a small amount of foliage on screen I would just leave it as non-manite you probably will get better performance from that but as soon as you want to add more foliage or denser foliage on screen then nanite starts to win out it's certainly comparable and as we saw when we added more foliage in the Glacier Valley nanite was definitely scaling up better as you added more and more foliage onto the screen so I'm sure they're only going to improve now light as well over time because there's been so much investment from epic games into both nanite and Lumen and virtual Shadow maps that I'm sure they're gonna continue to develop those as we go forward so definitely unless there's a reason not to let's use nanite foliage going forward so I hope you found today's video useful and I will see you in the next one
Info
Channel: UnrealityBites
Views: 19,364
Rating: undefined out of 5
Keywords:
Id: mq97V91YHGQ
Channel Id: undefined
Length: 16min 54sec (1014 seconds)
Published: Wed Jan 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.