Considerações sobre a performance

Otimizando a performance da renderização

«Uma chaleira vigiada nunca ferve» é o que os mais velhos dizem, mas você deve estar imaginando porque as suas tarefas de renderização levam tanto tempo para ser criadas, ou pior, acabam quebrando no meio do caminho! Bem, existem muitas coisas ocorrendo e muitas coisas que você pode fazer para acelerar as suas renderizações ou habilitar uma cena complicada para ser renderizada. Além do mais, é possível renderizar uma cena bastante complicada em um computador pessoal medíocre por ser uma pessoa «bem ambientada em renderizações». Aqui estão uma lista das «dez mais» das coisas que podem ou não ser feitas de maneira a acelerar a sua renderização ou mesmo evitar quebras durante as renderizações de cena. Algumas opções podem decrescer a qualidade de suas renderizações, mas para renderizações de previsão, como esboços, talvez você não se preocupe.

Caso você receba a mensagem «Malloc returns nil», diretamente em Inglês, isso significa que o alocador de memória tentou obter mais memória física para o Blender, mas voltou de mãos vazias. Isto significa que você não tem memória suficiente disponível para renderizar a cena, e o Blender não pode continuar. Você precisa fazer uma ou mais de uma das seguintes tarefas descritas nesta página de maneira a conseguir renderizar.

Melhorias no equipamento (hardware)

  • Instale mais memória em seu sistema.
  • Atualize a sua CPU para um processador de múltiplos núcleos ou sistema de múltiplos processadores.
  • Atualize seus controladores (drivers) de OpenGL para sua placa gráfica.
  • Obtenha memórias mais rápidas, até o limite da placa mãe de seu computador pessoal.
  • Use ou defina uma fazenda de renderização usando todos os PCs disponíveis em sua casa, ou use uma fazenda de renderização.

Configuração do sistema operacional

  • Aumente a prioridade de processamento do Blender através de seu sistema operacional.
  • Aumente o espaço de seu arquivo de troca usado pelo sistema operacional para a troca adicional de dados com a memória, chamado também de tamanho de arquivo de paginação de memória virtual, até o tamanho de sua memória física.
  • Use um monitor de sistema para verificar se quaisquer outros processos que estejam utilizando porções consideráveis de CPU ou memória RAM podem ser fechados.
  • Render in background mode (from the command line), saves extra memory.

Configurações do Blender

  • Increase the MEM Cache Limit in the User Preferences System & OpenGL tab.
  • Switch to an Orthographic camera, and render your own «parts» of the scene as separate images, and then paste those parts together in GIMP. An old trick in making your own panorama with a real camera is to take three or so pictures of a very wide (beach sunset) scene, where you take one picture, rotate to the right, snap another, then another, and when you get the pictures developed, you overlap them to make a very wide landscape image. Do the same in Blender: render out one shot to a file, then move the camera to look at a different area of the scene, and render that shot. Each shot will be of a smaller area and thus take in fewer polygons/faces. Be sure that when you position your camera that you snap overlapping shots, so that you can then match them up. If you do not want to use GIMP, you can use compositing nodes and the Translate node to match them up in Blender.
  • Minimize the render window (and the Blender window, if the UV/Image editor is used). ATI users report dramatic speed-up on a per-frame basis, which adds up over the frame range.
  • Use the Big Render script to render sub-sections of the overall image, and then paste them together.

Objetos e cena específicos

  1. Remove lamps, or move them to unrendered layers, or group them into layers.
  2. Turn off some lamp’s shadows, using only one or two main sun lamps to cast shadows. A few «shadows only» lights will render faster than every light having shadows on.
  3. Use Buffer Shadows rather than ray-traced Shadows.
  4. Bake your shadows using Render Baking Full Render bake on surfaces that do not move. Use that texture for that mesh, then disable shadows for that material.
  5. Simplify meshes (remove polygons). The more vertices you have in camera, the more time it takes to render.
  6. Remove Doubles, or use the Decimator mesh edit feature.
  7. Remove Subdivision Surface and Multiresolution modifiers.
  8. Delete backsides of meshes (removing unseen geometry).
  9. Render just a few objects at a time; in the beginning of your project, render the background objects and sets that will not change and will always be in the background.
  10. Put the buildings on another layer, and, through render layers, do not render them. Then composite them back in later.
  11. Make the camera static so that you can better accomplish the above two ideas.
  12. Evitando o uso de lâmpadas tipo área.
  13. Tornando os materiais insensíveis a luzes ou sombras.
  14. Render Bake AO and textures, and then make those materials Shadeless.
  15. Decrease the Clip distance for spot lights.
  16. Decrease the Clip distance for the camera.
  17. Desligue a oclusão ambiente.
  18. Desligue o espalhamento de sub-superfície do material.
  19. Use texturas de imagem menores. Uma imagem de 256x256 necessita de apenas 1% de memória quando comparada a uma imagem de 2K (2000 pixeis), muitas vezes praticamente sem perdas de qualidade na renderização final.
  20. Reduza as subdivisões das superfícies. Cada um dos níveis superiores quadruplica (4x) o número de faces do nível anterior.
  21. Reduzindo os níveis de múltipla resolução.
  22. Make a matte render of background objects, like buildings, and put the image of them on a billboard in the scene instead of the object themselves. This will reduce vertex/face count.
  23. If you have lots of linked instances of an object, use DupliFaces, as these are instanced. If you have 100 of them, Blender will only store the geometry for one. (Instances themselves take a small amount of memory).

Configurações de renderização

Painel Saída
  • Desabilitando a renderização de Arestas.
  • Salvar contingenciamentos.
  • Render to a UV/Image Editor, not a pop-up. Render Window.
  • Use multiple Threads on a multi-core CPU (with multiple Parts).
  • Decrease the frame count of the animation (and use a lower frame rate for the same duration of animation). For example, render 30 frames at 10 frames per second for a 3-second animation, instead of 75 frames at 25 frames per second.
Render Layers Panel
  • Renderizando somente as camadas de interesse.
  • Render with all lights set to one simple spot (enter its name in the Light: field).
  • Render with one material override (enter its name in the Mat: field).
  • Disable unnecessary Render Passes, such as Z, or only render the pass of interest, such as Diffuse.
Painel Sombreamento
  • Desligando as sombras.
  • Turn off Environment Mapping.
  • Turn off Panoramic Rendering.
  • Turn off Ray tracing.
  • Turn off SSS Subsurface Scattering.
  • Turn off or lower oversampling/aliasing OSA.
  • Turn off or lower Motion Blur.
  • Render in Parts. This will also allow you to render huge images on a weak PC. On a multi-core PC, it will assign a thread to each part as well.
  • Aumenta a resolução da árvore de octetos.
  • Render at a percentage size of your final resolution (like 25%).
  • Turn off Fields rendering.
  • Use Border rendering to render a subset of the full image.
Painel Gerar e gravar
  • Bake Full Render creates a UV texture that colors the objects based on materials, and then uses that UV texture shadeless instead of the material.
  • Gerando e gravando somente a oclusão ambiente.
  • Gerando e gravando as texturas para os objetos.
  • Baking Normals or Displacement does not speed up render time, and are used for other things.
Format Panel
  • Render at a lower resolution. Smaller pictures take less time to render.
  • Choose a faster CODEC or CODEC settings.
  • Render in black and white (BW button).
  • If using FFMPEG, do not activate Multiplex audio.
  • If using FFMPEG, Autosplit Output (Video panel button).
  • Render only RGB if you just need color; the A channel (RGBA button) takes more memory and is unused when saving a movie file.

Composição de múltiplos passos

Another strategy that can be used to address the problem of long (re-)render times is to structure your workflow from the ground up so that you make aggressive use of compositing, as described in the «Post-Production» section. In this approach, you break down each shot into components that can be rendered separately, then you combine those separately-rendered elements to achieve the finished clip. For instance:

  • If the camera is not moving, then neither is the background: only a single frame is needed. (The same is true of any non-moving object within the frame). These individual elements, having been generated once, can be reused as many times as necessary over as many frames as necessary.
  • Both shadows and highlights can be captured separately from the objects that are being illuminated or shadowed, such that the intensity, color, and depth of the effect can be adjusted later without re-rendering.
  • Start by using lights that do not cast shadows (shadow calculations are big time-killers). Then, use «shadow-only» lights (which cast shadows, but do not cast light) to create shadows only where you judge that they are actually necessary (it is very often the case that only a few of the shadows which could exist in the scene actually matter, and that the rest of them simply will not be noticed).
  • Tricky lighting situations can be avoided by handling the objects separately, then combining the individually-rendered clips and «tweaking» the result.

This is a very familiar idea. Modern sound recordings, for example, always use a «multi-track» approach. Individual components of the song are captured separately and in isolation, then the components are «mixed» together. The «final mix» then goes through additional processing stages, called mastering, to produce the finished product(s) (in fact, the features and design of modern sound-processing software are directly comparable to that of Blender’s node-based compositor).

There are compelling advantages to this approach:

  • If something is «not quite right», you do not necessarily have to start over from scratch.
  • In practice, the deadline-killer is re-rendering, which ordinarily must be done (in its entirety) just because «“one little thing” about the shot is wrong». Compositing helps to avoid this, because (ideally…) only the specific parts that are found to be in error must be repeated (or, maybe, the error can be blocked out with a «garbage matte» and a corrected version can be inserted in its place).
  • Sometimes you might find that it is almost what you wanted, but now you would like to add this and maybe take away that. A compositing-based approach enables you to do just that, and furthermore, to do so non-destructively. In other words, having generated the «addition» (or the «mask») as a separate channel of information, you can now fine-tune its influence in the overall «mix», or even change your mind and remove it altogether, all without permanently altering anything.
  • By and large, these stages work two-dimensionally, manipulating what is by that time «a raster bitmap with R, G, B, Alpha and Z-depth information», so they are consistently fast.
  • Since each discrete rendering task has been simplified, the computer can carry them out using much fewer resources.
  • The tasks can be distributed among several different computers.
  • «After all, the scene does not actually have to be physically perfect, to be convincing». A compositing-based approach lets you take full advantage of this. You can focus your attention (and Blender’s) upon those specific aspects of the scene which will actually make a noticeable difference. It is possible to save a considerable amount of time by consciously choosing to exclude less-important aspects which (although «technically correct») probably will not be noticed.

Of course, this approach is not without its own set of trade-offs. You must devise a workable asset management system for keeping track of exactly what material you have, where it is, whether it is up-to-date, and exactly how to re-create it. You must understand and use the «library linking» features of Blender to allow you to refer to objects, nodes, materials, textures and scenes in a carefully-organized collection of other files. You need to have a very clear notion, in advance, of exactly what the finished shot must consist of and what the task breakdown must be. You must be a scrupulous note-taker and record-keeper. But sometimes this is the best way, if not the only way, to accomplish a substantial production.