Troubleshooting FOLIAGE issues in Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everyone welcome back william fosha here today's topic is foliage or rather troubleshooting issues you may have had with foliage actors if you've been using unreal engine for a while you'll undoubtedly have run into the issue where foliage just doesn't behave the way you expect it to it's infuriating when it happens it feels like you're completely in the dark because you have no idea what's causing the problem let alone how to fix it in a perfect world you wouldn't need these fixes at all but here we are i get these same questions all the time i see these questions being asked all the time so let's sit down together and take a look at some of the most common issues and how to solve them now full disclosure before we get started this video does have a sponsor and that's skillshare so let's talk about the first issue that we run into and that's often disappearing shadow so i have a bunch of foliage here and when i move the camera away you'll notice that the shadows of the foliage just tends to disappear and there doesn't seem to be a way to get those shadows back so i've already talked about the solution to this problem in this video right here but i realized that that video is not exactly easily searchable for this specific issue so i want to talk about it again in this video and the solution to these missing shadows here is a console command so we're going to open up the console command menu and we're going to type r.raytracing.geometry.com instant static meshes dot culling zero it's a bit of a tongue twister but bear with me and when you enter the console command you'll see right away our shadows are now visible at any distance for our foliage so this is extremely helpful for foliage that had been painted very far away from the camera so often for trees in the distance and that sort of thing so this is a very good tip to know about it can really get you out of a blind and with that said let's move on to issue number two now the next issue i want to talk about is weird shadows on foliage when you're using any kind of wind system you may have noticed it on some of the mega scans assets where the moment you enable the grass wind nodes on the materials of your fern or foliage whatever you're using you will get these odd shadows when you're using ray tracing specifically so let me show you some of the effects here so if i select my sun and my skylight and disable raytrade's shadows you'll notice we no longer have any of those weird shadowing issues right the wind kind of behaves as normal you'll see here the wind is very very subtle but we don't have any awkward weird shadowing and the moment i turn back raytrace shadows on both my sun and my skylight you'll see that things suddenly turn to total garbage this is completely unusable we are getting the exact same issue on trees here like that you'll see where the there's this big large black spot here that eventually will move once the wind kind of kicks in like this here all of this is caused by ray tracing but fortunately there is a way to fix this so how do we fix that problem we're going to start by selecting our tree here and in the search details panel we are going to search for evaluate and we're going to click on evaluate world position offset that you see right here and pay attention to this black shadowy area here when i click on this it's gone now our wind will behave as expected on our trees without any of that wonky shadowing but this tree is a static mesh not a foliage actor so let's see right here and let us go into the foliage mode here by selecting our foliage actor in the foliage list and we're going to scroll down into settings here until we see evaluate world position offset and you'll see right here we've got evaluate world position offset in the foliage actor itself so i'm going to click this but you'll see nothing happens it doesn't work with foliage actors unfortunately i don't know if this is a bug or not but fortunately there is a workaround to this it's a little bit of a hacky work around and probably not the most efficient work around but there is a way to get the evaluate world position offset to work correctly on foliage actors not just static meshes so what we're going to do is in the content browser i'm going to right click and i'm going to create a blueprint class and i'm just going to create a regular blueprint actor i'm going to call this common fern evaluate wpo and now we're going to open up that blueprint and in our blueprint we're going to drag and drop our common fern here into our blueprint scene like so now we select our fur in here and in the details panel here we're going to search for evaluate again and we're going to click on evaluate world position offset okay we're going to hit compile and save we can close this but there is still one more thing we need to do here before we finish so what we're going to do is we're going to right click in our content browser go to foliage go to actor foliage right here and i'm going to call this common fern wpo i'm going to double click on this and drag and drop our new blueprint that we just created into the actor class slot up here once that's done we're going to hit save we can close this new window go back to the foliage tool and now we can drag and drop our new actor foliage that we just created into our foliage list right here and now i'm just going to make sure that my new foliage actor is checked in my foliage list and not the other one and i'm going to paint the new ones right here and as you can see we now have wind with ray tracing on our foliage without the really nasty shadowing issue that we had over here so like i said this is a bit of a hacky work around and this may actually be detrimental performance wise but sometimes you just need to get those results quickly and you don't care about performance so this is a totally valid work around if you need good results fast so just to recap if you're using static meshes all you need to do is select evaluate world position offset in the details panel but again if you're using foliage you're going to need to create a blueprint bring that foliage into that blueprint create a foliage actor out of that and start painting that blueprint actor foliage like i said it's a little bit of a hacky work around now the next issue that i see a lot of people having usually has to do with this you may notice that with some fully ejectors the moment you move the camera more than a few meters away uh everything just kind of pops away looks really gross but the shadows are all super wonky and still look very sharp the reason for that is pretty simple it's lods and this is actually only an issue with ray tracing specifically so if i go ahead and turn off cast ray tracing shadows in my directional light you'll notice that the shadows are actually based on their respective lod which is you know what it's supposed to do but with ray tracing that is not the case you'll see we're still getting the shadows being cast by lod0 even though over here it's lod 5 or something so this actually may explain why ray tracing has such a large performance impact because it is still casting shadows based on the lowest lod that said i'm not a rendering engineer so i'm not going to pretend i know what's happening under the hood here but with that being said we do have a solution for this there's two things that you can do it should go without saying that this is lod related so the first way to solve this is to open up your static mesh editor and scroll down and set the number of lods to one that will essentially get rid of all the high lods or a less destructive approach is to open up the console command menu and type foliage dot force lod 0 and that's going to essentially well as the name implies it's going to force out d0 on all the foliage actors and they won't get that really nasty popping effect anymore if you're rendering your shots with the movie render queue i believe the movie render queue already uses this console command under the hood i don't think you need to use it yourself but if you want to be on the safe side or if you're still seeing this issue when rendering at the movie render queue you can go ahead and add that console variable in the console commands menu of mrq if you don't know how to render with the movie rendiq i made a whole video about it right here so go check that out and you'll see that this is a fantastic way to improve the quality of all of your renders now this video is sponsored by skillshare so a big thank you to them for helping me help you with more videos like this and if you want to learn more about unreal or 3d modeling texturing lighting compositing vfx skillshare is pretty much the best platform to do just that skillshare has a whole bunch of classes for the curious minded people like us you don't even need to take a class related to our field of work either you can learn with thomas frank about mastering productivity you can learn how to make a delicious burger you can even impress your date by learning how to cook i can't cook skillshare's classes spend a vast range of topics they're curated they're high quality ad-free and they're constantly releasing new classes so if you were to pause this video right now and click the link below the first thousand people to click will get a free trial for a month which is pretty awesome because skillshare is remarkably helpful if you're someone like me who just constantly has new things to learn thanks again to skillshare for sponsoring this video and let's get back to one last tip for you guys so the last thing i want to talk about is general flickeriness and jitteriness that you see in foliage at times so you may notice that like up here we're getting a little bit of jitteriness and flickeriness it's very noisy you kind of see in the bushes here you'll notice it in a few areas across the frame now you may also have seen this in previous renders that i've made for other videos and if you pay attention right here notice at the bottom as soon as the camera moves a little bit we get that really annoying odd jitteriness or flickering and in this sequence you'll notice i have the kind of sudden flickeriness happening in the foliage sometimes it occurs on one or two frames sometimes it occurs on several frames but in general the main reason this is happening there are two things that can cause this the first one should go without saying that resolution if you don't have enough resolution you're going to be getting quite a bit of flickering okay so going back right here you can get a better preview of your viewport by clicking on the little arrow right here and setting your screen percentage to 200. now be careful if you're running a very heavy scene this is going to tank your frame rate in fact it can cause unreal to crash because screen percentage 200 is very performance intensive so i'm going to set it to 200 and hope that it doesn't crash but you'll notice that your viewport suddenly gets much sharper and much crisper and your foliage is not going to jitter quite as much and you'll see now everything is a lot sharper the jitteriness kind of disappeared we have much much cleaner result now and that is a testament to the fact that when you're on your viewport is pretty small sometimes you just don't have enough pixels to get a clean result so it's really important to keep in mind that a higher resolution render will give you a much cleaner less noisy result sometimes this tip is almost essential when you're trying to render high quality grass you're going to need more pixels to get a nice clean crisp grass in your scene there's just no way around it you need that resolution so what you can do at render time is to set the screen percentage 200 console variable in the movie render queue now again like i said if you're rendering at 4k and you use screen percentage 200 you're probably going to have a bad time rendering an 8k unreal is going to choose your desired resolution so for example 4k it's going to set it to 200 hence screen percentage 200 which means it's going to render it in 8k and then once it's done rendering it's going to super sample it back down to 4k giving you much sharper results much more crisp details it's going to remove a lot of noise and overall your result is just going to look that much better that said you need a whole crapload of vram to handle this so use this with caution so that was the first thing you can do the second thing you can do to reduce noise and overall unpleasantness and artifact in your foliage at render time is by opening up the movie render queue settings and again if you haven't seen my movie render queue tutorial i absolutely recommend you check it out right here because it is going to completely change the way that you render your images out moving forward so with the movie render queue settings open right here i'm going to go ahead and go to the anti-aliasing tab and as always i always recommend turn off anti-aliasing and set the temporal sample count to 16 or something like that 16 or 32 is usually a sweet spot i use 16 temporal samples for i would say 90 of all my renders it's only in some cases where there's an extreme amount of motion blur that i have to increase the temporal sample count but in general 16 temporal samples is more than enough and secondly in order to get a slightly better result in our render to get rid of some of that noise we can increase the spatial sample count and set it to 2. now keep in mind these two numbers here are going to multiply one another so what i mean by this is if i had left this at 1 my render would be split up into 16 slices 16 temporal samples but by setting the spatial sample count to 2 you're actually multiplying 2 by 16 so you will actually be rendering 32 samples okay so it multiplies like that so now why are we adding a spatial sample instead of just cranking up the temporal sample to 32 and leaving spatial sample at one well without diving too deeply into the specifics temporal samples should be used to get better motion blur while spatial samples are really good if you want some nice crisp detail some really nice super sampled results so combining these two can absolutely work in your favor again this is just our general rule of thumb feel free to experiment and try your own settings and see what works and see what doesn't but in general 16 temporal and two spatial subsamples gets rid of a substantial amount of noise you're going to get some cleaner results that way so again i have an entire tutorial dedicated to the movie render queue and getting better results so definitely go check that out if you haven't already now before we take off today there is one thing i want to touch base on and this is not so much of a tip as more of a request for help so i've gotten a lot of questions and i've had a lot of people ask me about issues they've had with foliage just disappearing in the middle of a render now i've not been able to replicate that issue some people will say that they're starting to render you know they have all their foliage in their viewport but when come the time to render everything is gone they can't find anything their foliage their grass has completely disappeared they have no idea what happened and again like i said i haven't been able to replicate that on my end but if you have had that issue and you're able to reproduce the issue i want to hear from you i want to get to the bottom of this issue my gut feeling tells me that this is vram related so i haven't tested this per se but i have a feeling that when the movie render queue is hitting that vram limit it's possible that it starts calling out foliage first just to be able to complete the render so keep an eye on your vram and see if you're having issues that way i'm not saying that that is the solution to your issue but it very well could be so again do let me know if you have a scene with a reproducible issue i want to hear from you i want to get to the bottom of that problem and if we do end up finding the solution to that issue i will post it in the pin comment down below and that's it we're done i hope you found this video helpful and or entertaining and if so consider subscribing and hitting the like button down below thanks so much for watching and i'll see you all next time
Info
Channel: William Faucher
Views: 32,321
Rating: undefined out of 5
Keywords: UE4, Unreal Engine 4, Unreal Engine, Cinematics, 4.26, UE4 4.26, UE5, Realtime, realtime rendering, rendering, CGI, 3D, 3D Artist, foliage, issues, shadows, flickering
Id: Ar3vvygirLU
Channel Id: undefined
Length: 17min 20sec (1040 seconds)
Published: Thu Nov 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.