How much of the light is reflected or refracted<\/li>\n<\/ul>\nAnd that\u2019s just a single ray in a simple scene. Imagine having to calculate many, many rays for each surface of your scene.<\/p>\n
Fortunately, the PC\u2019s CPU (Processor) and GPU are fast and pretty good at doing such calculations - much better than we humans are - and the GPU (Graphics Card or Video Card) in particular is custom made for such graphical and \u201cray-tracing\u201d calculations.<\/p>\n
Now, where am I going with this?<\/p>\n
Although we could dive in much deeper into how Render Engines work, the above description should already <\/em>be enough to analyze and optimize our scenes to render faster:<\/p>\nSince the majority of what a render engine does is trace a bunch of rays through the scene, which then bounces off of objects, we can already deduct the following:<\/p>\n
\nThe fewer rays <\/strong>we need to render a noise-free<\/em> image, the faster the render process will be complete<\/li>\n<\/ul>\n\u201cNoise-free<\/strong>\u201d: That\u2019s a new term we\u2019ll take a quick look at:<\/p>\nYou\u2019ve most likely seen it before. Images that are rendered in low quality are not smooth or clear. They have noise or grain all over the place making it difficult to discern details.<\/p>\n
<\/noscript> <\/p>\nThe reason is simple, and that\u2019s the last of the introductory theory we\u2019ll need for this article, so bear with me just one more time.<\/p>\n
Here\u2019s where that noise comes from and how we get rid of it:<\/p>\n
Any image (rendered or not) consists of pixels. The render engine takes a sample for each pixel.<\/p>\n
The render engine, which we\u2019ll place inside the scene\u2019s camera for simplicity, traces one ray<\/em>, through each of the pixels and then knows what is behind that particular pixel. This is also known as \u201ctaking a Sample\u201d.<\/p>\nTrace a ray through a pixel and hit wood, there\u2019s wood there. Trace a ray through a pixel and find metal, there\u2019s metal in that area of the image. Simple enough.<\/p>\n
BUT, and this is the important part: A pixel is not one-dimensional, it\u2019s two-dimensional. Basically, each pixel is a two-dimensional square. A bunch of the squares together is an image.<\/p>\n
So why is this important? Because a ray, or sample, that we trace through a pixel to see what\u2019s in the 3d scene behind is one dimensional<\/em>. To get the average of what\u2019s behind the entire <\/em>square area of the pixel<\/strong>, we would have to trace multiple rays<\/em><\/strong> (take multiple samples) through that and each pixel.<\/p>\nTake this example:<\/p>\n
<\/noscript> <\/p>\nIf we trace just one ray through the X and hit the orange triangle, the Render Engine thinks the entire Pixel is filled\/covered by the orange triangle, while it actually just covers the bottom right part of that pixel.<\/p>\n
With multiple rays\/samples taken of that pixel, we would know that 90% of that pixel is in fact white\/grey and not orange (Some is green too). So with multiple samples taken, we can deduct an average color for that pixel.<\/p>\n
So if we use only one or a low number of samples per pixel, <\/em>we don\u2019t exactly know what is behind the entire <\/em>pixel, just behind the one-dimensional point that our sample was taken from.<\/p>\nThe result: Our error threshold is high and we get a noisy image.<\/strong><\/p>\nThe more <\/em>samples we trace through each of our pixels the lower the error-, or noise-threshold and the less <\/em>grainy our resulting image will become.<\/strong><\/p>\nPhew! That was quite an excursion into the inner workings of how rendering actually works.<\/p>\n
Now keep in mind that all render engines have their own ways of optimizing certain things, and there are ways to fake or optimize certain processes, but the general functionality can be applied across the board for any render engine.<\/p>\n
The more samples you take of your scene, the smoother the result.<\/strong><\/p>\nWe can say this too: If there\u2019s not much going on in your scene, you\u2019ll be able to get away with fewer <\/em>samples than when your scene is full of complex objects, complex materials, or complex lighting.<\/strong><\/p>\n<\/span>How to render faster<\/span><\/h2>\n<\/span>Internal Factors: Optimizing your Scene<\/span><\/h2>\nEnough theory, let\u2019s render faster.<\/p>\n
A big part of some of the optimization methods we will take a look at now will involve reducing the complexity of the scene, so we can get away with fewer samples while still achieving a noise-free resulting image.<\/p>\n
Remember those two steps involved in reducing rendertime? Step one is to find what is actually causing the slow-downs<\/strong>.<\/p>\n<\/span>Find the bottleneck first - Exclusion principle<\/span><\/h3>\nThe easiest way to find what is causing your slow-downs is by utilizing the exclusion principle<\/em>.<\/p>\nTake this example: If we had a hundred objects in our scene and one of those objects is causing the render slowdowns, the fastest way to find this single object is through the exclusion principle.<\/p>\n
Now, I could just delete one object at a time, and eventually, in a worst-case scenario, after a hundred tries, I\u2019d find the culprit, but there is a faster way.<\/p>\n
Always delete (or disable) half of the objects and test the result (re-render). Why? Because by deleting half <\/em>of your objects you can already reduce the number of objects you have to go through to find the culprit by 50%<\/em>!<\/p>\nSo now we have 50 objects. Does it still render slowly? Yes? Delete half of those remaining 50 objects again.<\/p>\n
Does it still render slowly? No? Great! We now know that the culprit is within those 25 Objects that we deleted last.<\/p>\n
So now we are down to just 25 objects from a hundred, in just 2 steps.<\/p>\n
Continue doing this until you have found the object.<\/p>\n
(Obviously, this is just for finding and testing where the problem resides, don\u2019t save\/overwrite your scene.)<\/p>\n
The exclusion principle can be applied to anything. To meshes, materials, lights, keyframes, you name it.<\/p>\n
Always narrow down the area of your problem as much as possible. Get as close as you can to the culprit, and you\u2019ll often find the fix is a lot easier than you thought.<\/p>\n
Which of the following Forum requests do you think will allow others to help you better?<\/p>\n
\n\u201cPlease help: My scene renders slow\u201d<\/li>\n \u201cPlease help: Why do my trees in my scene render much slower than the rest of my scene (Redshift)?\u201d<\/li>\n<\/ol>\nI can guarantee you, if you get an answer to the first, it\u2019ll be this: \u201cPlease narrow down on the source of the problem first\u201d.<\/p>\n
The second, though, might get an answer right away: \u201cMost 3D Trees have leaves that usually have transparent materials on them. Try limiting the transparency trace depth and see if rendertimes get better or if your render engine has a shader that works better with high transparency depths.<\/p>\n
Redshift has a stencil mat that has no slowdowns even with high transparency depths. Try using that.\u201d<\/p>\n
Now, that second one sounds like it\u2019ll fix your problem right away. Because you already knew what object was causing your slowdowns, others could help you much faster.<\/p>\n
By excluding things you can factor them out of the equation.<\/p>\n
Exclude scene objects? Still rendering slow? Your scene itself will most likely be fine.<\/p>\n
Reduced your render settings? Still rendering slow? Your render settings were most likely fine.<\/p>\n
Swapped your CPU or GPU? Still rendering slow? The CPU or GPU will most likely have nothing to do with your render slow-downs.<\/p>\n
You get the gist. Easy as that.<\/p>\n
Of course, the problem can always be a combination of different areas, but we\u2019ll get to that a bit later.<\/p>\n
Remember, reduce what can cause the slowdowns to find the culprit.<\/p>\n
Then we can work on a fix.<\/em><\/p>\nIn this article, I\u2019ll address some typical areas that are often found to be the reason for rendering slow-downs and you might be able to fix your problem with those methods.<\/p>\n
They won\u2019t always <\/em>work though, so try to learn the skills of analyzing and dissecting your scenes yourself<\/em>, then you\u2019ll never need outside help for this ever again.<\/p>\nPeople will come to you<\/em> because you\u2019re the expert. All it takes is some insight into problem-solving in the world of 3D (not just rendering).<\/p>\n<\/span>Find the bottleneck first - Check your samples<\/span><\/h3>\nAlmost every modern Render Engine has the ability to visualize the number of samples taken for each pixel. Here\u2019s how this looks in Redshift:<\/p>\n
<\/noscript> <\/p>\nDark Pixels represent a lower number of Samples, bright Pixels a high number of Samples.<\/p>\n
Being able to render your Image and see at a glance what areas need the most samples, can tell you a lot about your scene and where to start with your optimization.<\/p>\n
A sample distribution visualization tells you if your render settings are configured badly, or if there are certain scene objects, materials, or lighting that just need too many samples to clear up.<\/p>\n
<\/span>Find the bottleneck first - Check your viewport<\/span><\/h3>\nA lot of times, all you need is to check your viewport in \u201clines Mode\u201d so it displays all of the Polygon outlines in the viewport.<\/p>\n
Take the following scene as an example. It is clear at a glance which objects have a lot of polygons that should have some potential for reducing:<\/p>\n
<\/noscript> <\/p>\nViewport Screenshot set to (Hidden) Lines View<\/p>\n
<\/span>Find the bottleneck first - Check your Scene & Object info<\/span><\/h3>\nEvery 3D App can display Polygon counts for the entire scene or for the objects you have selected. Here\u2019s how this looks in Cinema 4D:<\/p>\n
<\/noscript> <\/p>\nRemember that Principle of exclusion from before? Check the Polygon Count of the entire scene first. If it seems high, select half the Objects and check it again.<\/p>\n
Reduce the number of Object selections until you find the Objects that have unreasonably high Polygon counts and optimize those.<\/p>\n
If you have a well-structured scene with a couple of main Object Groups, you can also just step through those and work yourself down through the hierarchy, which might be faster.<\/p>\n
<\/span>Reduce the number of Polygons<\/span><\/h3>\nA big factor in rendering performance is the number of Polygons in your scene. As a rule of thumb, you can say that for most scenes, the fewer polygons you have, the faster you\u2019ll be able to render it.<\/p>\n
Here\u2019s a list of where those high number of Polygons come from most of the time:<\/p>\n