The Easy Way to Optimize Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

comment edited to stop creeps like you reading it!

👍︎︎ 2 👤︎︎ u/Catnip4Pedos 📅︎︎ Aug 01 2022 🗫︎ replies
Captions
when the topic of getting more performance out of blender comes off people offer the same basic advice all the time you need to better optimize your scenes but the problem is a lot of people don't really know how to do that and there doesn't seem to be a lot of good information online about how it's done the information that is out there is pretty out of date too now when people send me files through say a patreon or even when i look at my old work i'm often surprised about just how badly optimized the scenes are and if you optimize things properly you can often bring down render times from sometimes hours to just minutes so in this video i'm going to show you basically everything i know about how to optimize scenes in blender but before we get started i've got a little upgrade to make to my system this video has been sponsored by nvidia and scan and they've sent me this it's an rtx 3090 ti the biggest baddest graphics card that you can buy right now unfortunately i don't get to keep this one because good news for you guys is i'm actually giving it away i'm gonna have a competition which i'll announce in my next video probably but you're gonna get the chance to win this thing but for now we're gonna stick it in the system and see how it performs i'm pretty excited to get this thing installed i haven't even actually took a look at this yet if competitions aren't your thing then there's a link in the description where you can see scans whole range of rtx power devices so with all that said let's jump into blender and start optimizing some things now before you can really understand how to optimize a blender scene it's really good practice to actually understand the basics of how a path tracing engine works in real life a light source shoots out photons in all directions some of that light will directly hit your eye and some of it will bounce around a few times first each material that the light encounters on its root to your eye will change the light a little bit some of the light will be absorbed in a low strength some of it will be refracted and it'll change directions and some of it might even change wavelengths which will make it look a different color now it would be incredibly inefficient for render engines to trace out the path of every single light ray for every light in the scene most of them are never going to hit the camera instead what path dresses do is they go in the opposite direction a ray gets fired out from the middle of each pixel it bounces around the scene a few times and then it goes to the nearest light source now that we know the path that the light should take through all the things and we know the materials that it'll bounce off we can just reverse engineer the probable color and brightness of each pixel each light ray that we test like this is called a sample using only one sample does give us a big problem though different light paths are going to bounce around in different directions and that's going to create a lot of noise so one sample might head straight for a light source while the pixel next to it the only sample that you test might bounce off into space and never reach a light so we can reduce the noise a lot just by testing each pixel multiple times with different samples and then we can take an average value to decide the brightness for that pixel that generally makes the brightness and the color of each pixel next to each other much more consistent but you will still always get outliers especially very bright outliers that we call fireflies now in blender if you have an object just by itself like this in space it usually has very little noise that's because most of the light rays are direct rays they just hit the object and they head straight to the camera blender loves this sort of setup because there's very little bounce lighting but as soon as we move this model inside an interior we get loads of noise that's because now the majority of the life paths that are bouncing around are hitting the side of the walls they're going all over the place before they hit the camera so if you're working on an interior scene there's a few things that you might want to bear in mind number one is to try and make your light sources as large as possible the smaller the lights entrance into the scene the harder it will be for most of the light paths to actually find where the light is coming from which will create fireflies for the few that actually do find the way out so this is the same saying rendered with the same sample account they have a very similar level of basic background noise but the one with the larger entrance has much fewer fireflies in fact it has basically none while the version with the small hole has loads of fireflies in the dark areas now this goes for any light sources in blender smaller lights create more noise than larger lights if you have a scene like this which is lit from the outside you can help blender to find the light's entrance into the scene by placing an area light over that hole and setting it to portal board that doesn't do much about the general background noise but it generally does a very good job of reducing fireflies when i'm working on an interior scene one of my favorite tricks to optimize things is to use approximate gi i've made a whole video about how this works before but this basically uses just a little bit of guesswork to try and figure out how light should bounce around the scene it is a little bit less accurate than doing it for real but the results are really great i think and it can massively increase render speeds i use this for basically every scene that i render you can also use the clamp settings to reduce fireflies if you clamp indirect that basically sets a maximum amount of brightness that a bounce rate can be it really reduces fireflies and it can reduce general noise in the same as well if you look at some of the benchmark scenes like the bmw or the classroom you'll notice that they've been clamped quite heavily because they're pretty well optimized disabling reflective and refractive caustics used to be very important for optimization but these days with the latest versions of cycles it doesn't really seem to affect things very much it can sometimes be beneficial to turn them off if you've got a scene that's coming through a lot of glass but generally speaking i wouldn't worry about it but while we are on the topic of glass let's talk about how to optimize it when blender fires out a sample add an object that ray is basically split into two different kinds one of them is the bounce ray which we've already discussed and the second type is a shadow ray now these are really important it's their job to figure out if a pixel is directly lit by any light sources or whether some other object is casting a shadow on it now the problem with glass is that it's refractive so when the shadow ray gets fired off an object and heads towards the light source as it goes through the glass it changes direction slightly and basically it misses since blender now thinks that the whole scene is only lit by bounce lighting with no direct lighting anything that's inside the room will be much noisier and darker than it should be now we can fix this issue really easily just by adding a few nodes into the glass add a mix shader and a transparent shader then using the light path node grab the output that's called is shadow ray and use that as the mix factor this basically tells blender if you're tracing out the shadow and you're trying to find the light sources and you hit this glass just treat it like it's invisible otherwise just render it like it's regular glass now your shadow rays will have no problem finding the light source when they go out the window and you'll get much less noise and much brighter interiors now denoising is obviously a great way to optimize scenes too because it allows you to use less samples someone sent me a file recently through patreon to take a look at they were trying to clean it up because it was very noisy they were using something crazy like 8 000 samples and it was still really noisy i turned on the optics denoiser and with something like a thousand samples i got to look perfectly clean in fact modern day noises can work with surprisingly noisy images and make them look very good blender comes with two different denoises there's the ordin denoiser by intel and there's nvidia's optics denoiser now personally i prefer the opticsd noise there especially in the viewport because it's much more performant now one drawback that you get traditionally with denoisers is they can sometimes produce jittery artifacts if you have an animation now the reason that this happens is because each frame is denoised separately which means it doesn't know what the last frame looks like but optics is getting a really huge update in this regard which makes it temporal long story short what that means is that you'll be able to render out noisy animations and it should clean them up with basically no artifacts now this ability is already actually built into optics but you can't really easily access it in blender you have to use a little bit of python at the moment but the blended developers are working on a proper implementation right now so hopefully soon we should just be able to hit a button and you'll get really nice clean renders even on animations using denoising now one tip that i've mentioned before if you're using the optics denoiser and you have volumetrics in your scene is to change the type to albedo only i don't know why but in my experience it tends to make a much cleaner look speaking of volumetrics let's talk about how you can optimize them a little bit now the easiest way frankly is to just avoid using volumetrics altogether and use the mispass instead this doesn't work for smoke or clouds obviously but if you just want to add a little bit of fog or mist into the scene or a little bit of atmospheric perspective then this is a really great route to go down you just have to enable the missed pass and then in the compositor after you render you can add in a mix node and you can mix the original image with some sort of say white or slightly blue depending on what color fog you want color and then you can use the miss pass as the factory to control weather cause you can also stick a color ramp in and get some more fan control over the mist pass if you just want a little bit of general sort of dense fog like an overcast day what you can also do is get rid of the normal volume nodes and instead just use an emission shader plug straight into the volume slot now sometimes this can actually work really well and really bring down your render times i actually used this for my jurassic park video it is a little bit of a cheat so you don't get effects like volumetric shadows but if you just want a tiny little bit of fog this can be a good route to go down if you have an rtx gpu you can actually access nvidia's nano vdb technology which is a much faster gpu accelerate algorithm for real-time volume metrics i used to avoid volume metrics entirely just a couple years ago because they always took so long to resolve when it came to the render time so it's pretty mind-blowing to me that we can do this stuff basically in real time these days now sprinkled around blenders interface in a couple of random different places there's a few buttons that you can turn on to improve render times as well if you go into the sampling section under the advanced settings part you can turn on this automatic scrambling distance function this basically reduces the randomness of which direction light bounces go off in which makes the noise a little bit more consistent across all the pixels in the performance tab you can turn on persistent data this keeps data that would otherwise get disregarded in between frames it can be a little bit glitchy sometimes but it's usually worth enabling anyway even if you have any glitches in an animation it's probably just one or two frames in which case you can just re-render them out but my recent zombie tutorial the animation for that was 2400 frames i used persistent data and it didn't cause any issues at all if you have any volumetrics in the scene you can also reduce the max steps and increase the step size you can think of this kind of like lowering the resolution of the volumetrics it's a little bit less accurate but honestly you can't tell much of a difference in the render settings there's this section called noise threshold now this is what used to be called adaptive sampling there's basically no reason to ever have this turned off in my opinion it stops rendering out a pixel once it makes a certain level of noise no matter how many samples it's used okay moving on let's talk about some more light optimizations firstly you're going to try and want to avoid having any light actually touching another surface or even coming very close to them especially if they're very bright lights what this does is it makes a huge patch in the scene that blender just thinks is incredibly bright any rays that hit that wall right next to where the light is they're gonna bounce back and be like whoa this is crazy bright and you get fireflies if you do have to have a light source right next to a wall there's also a nice little node trick you can do to reduce some of the noise if you go into the light settings and select use nodes then you can add some nodes into the light shader add a mix shader into the scene and plug the emission into that then use the light path node again but this time we're going to mix in the ray length output of the mix factor it's also a really bad practice to use an emissive material to light your whole thing you say blender doesn't really treat an emissive surface like it's an actual light source it doesn't get picked up by the shadow ray in the same way which means that it's much much noisier so if you do need to have a scene that looks like it's lit by actual lights which you often do in an interior there is a really good workaround for this if you go into the material nodes for the emissive surface and you add one of those light path nodes again and then you add in a mix shader you can plug the emission shader into the bottom slot and plug the camera ray into the mix factor now what this does is it tells the blender to treat the surface as emissive only if the ray that hits it goes straight to the camera if the ray is going to bounce around the scene and it's going to create loads of noise it should be ignored now obviously we've just removed all the bounce lighting from this thing so we need to replace it with something so the easiest thing to do is just place an area light directly below the emissive surface now it looks like the light is on and you get all the nice lighting but it's very clean and free of noise now even though this looks fine for now it does actually cause two issues if we add a reflective surface of some sort into the scene you can see what they are the emission actually looks like it's completely black and the second light source is visible to the camera and the whole illusion is kind of broken now we can turn off the reflectivity of the light really easily we just need to go into the settings and untick multiple importance for the light but we also need to figure out a way to bring back the reflection of the light in the surface we can do that quite easily we just need to add a math node and place it in between the light path node and the mix shader then we're going to get the second output here that's called is glossy ray and we're going to plug that into the second slot what that does basically it just brings back the emission but light bounces if they ever hit a reflective surface using this setup it looks like the light is on but the actual emission is coming from a light source instead so it's much less noisier in general i use node setups like this all the time when i'm working on interiors that zombie short movie that i made all the hallway was lit in this exact same way so finally let's talk about motion blur motion blur is really important to replicate realistic movement but it does take a lot longer to render you can reduce the amount of motion blur which does actually decrease the time penalty as well but obviously you will get a little bit less blur on the scene you can also use a workaround which is called vector blur if you enable the vector pass and you go into the composite after you render it out you can basically fake it with this vector blur node you just need to connect the right information up and it'll add a little bit of blur and post now it does work okay for some elements but personally i don't like to use this because i don't really think it looks very good if you have a second generation rtx graphics card then you have access to gpu accelerated motion blur in blender it massively brings down render times for motion blur and i love this thing it's already built into blender you just have to render with optics and it should work right out the box now gpu motion blur nano vdb optics rendering and denoising are all part of nvidia's studio program that's an initiative to empower creatives with better hardware and software solutions scan has a really nice range of rtx powered hardware on their site i've personally trusted scan for well over a decade now and i can see from my experience that they offer a really good service you can see all their rtx goodies in the link in the description and don't forget to subscribe if you want a chance to win this rtx 3090ti the announcement video for the competition should be going live in the next week you
Info
Channel: DECODED
Views: 42,516
Rating: undefined out of 5
Keywords: tutorial, DECODED, Blender, blender 3d, software, computing, classes, open source software, 3d software, vfx, vfx artist, blender optimization, optimisation, how to speed up blender, b3d, make blender faster, blender for slow computers
Id: rtEoAuSAbLM
Channel Id: undefined
Length: 16min 39sec (999 seconds)
Published: Sun Jul 31 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.