Maxwell tips for VFX

Table of contents:


Maxwell Render - ready for VFX?

Maxwell Render first appeared in 2004. Today, it continues to be the benchmark for render quality - with many of its innovative features being adopted right across the market. The backbone of the Maxwell Render project during these last 10 years has been “quality first”, and we firmly believe that this approach is the only sensible one in the long term.

More recently, Maxwell has attracted the attention of the animation and VFX industry. This change is brought on by the realization that the time and effort required to reach that final image quality involves a lot more than just the final render time, it involves the entire workflow. And perhaps even more importantly, VFX artists want to use their skills and knowledge of how light behaves in the real world - without the technical, the tricks, and the plain boring getting in their way. Some of the finest renders we've ever seen are from photographers who have never touched a render engine before. Rendering is not an art - creating a stunning visual is.

Composite and render at the same time

One of Maxwell's special features that goes beyond the traditional rendering workflow is the ability to resume a render at any time. What this means in terms of workflow is that you can render a sequence to a low Sampling Level (SL) very quickly, to get an idea of the lighting and materials - start compositing with this low SL sequence - while Maxwell continues to render in the background, refining the quality. As the SL increases, the sequence automatically updates in your compositor to show you the latest SL quality. This allows you to get to the final piece much faster. There is also another advantage: usually along the lifetime of a sequence, the final quality is reached at the very end, and the supervisor/director/client cannot make a good judgement of what needs changing if what they see is the beginning of the scene setup / render process. With Maxwell, the only difference between a fast low SL render, and a high SL final render is the amount of noise in the render - which still allows you to see what the final lighting will look like very early on. Fast, realistic proposals - less work needed to get a final approval.

MultiLight. Render once, re-light to your hearts content

MultiLight is still one of Maxwell's most appreciated features - it allows you to change the intensity (and optionally also color) of any light in your scene - during and after rendering. You can adjust them also as separate channels directly in your compositing application using our plugins (currently Nuke, After Effects, Photoshop). With ML on, it's a matter of a few clicks to turn a daylight render into a night time one, or completely change the mood of a scene - all without having to re-render. Please see below for tips on working with ML.

Flexibility

Although we are obsessed with quality and taking a real world approach to rendering, it doesn't mean we don't understand the needs of our users to "bend" reality when needed. It is often said that unbiased rendering means no flexibility. This is simply not true. To mention a few concrete examples in Maxwell: you can hide objects to camera but still have them influence the scene lighting and reflections, you can hide objects to reflections/refractions, you can hide objects to GI, you can render a diffuse only pass, or a reflection only pass, you can turn direct or indirect caustics on/off, you can render a motion vector channel in case you wish to do the motion blur in post, a shadow pass channel (which takes into account the full GI of the scene and changes to lights using ML), a fresnel pass, a normals pass etc. You can find the full list of render channels available in Maxwell here. And the object visibility options are described here.

Mature feature set

Easily controlled true 3D motion blur with unlimited substeps, accurate displacement (incl. vector displacement), instancing, MXS referencing, high quality materials, subsurface scattering, hair/fur, grass, emitter settings using real world values, real world film/photo camera settings (incl. anamorphic bokeh effects), accurate reflected/refracted caustics, RealFlow connection for rendertime meshing of RF particles (included with each license of Maxwell), IES lights... 

MXI file

During the render, Maxwell generates an image file (in your desired image format: exr, tiff, tga, jpg...) plus another image file in the proprietary MXI format (stands for Maxwell Image format). 

This MXI file is a high dynamic range version of your render but with very interesting properties: it can be resumed to a higher and cleaner Sampling Level, it allows you to adjust the camera exposure of the rendered image and also to adjust your lights separately (re-light your image) if the MultiLight feature was turned on, apply SimuLens realistic camera lens effects, and it contains all the extra channels you specified (Z-buffer, materials and objects ID, motion vector, position, normals...). 

Scalability - Multi-Cores and Distributed rendering

Distributed rendering is certainly not a feature unique to Maxwell, but an advantage over traditional render engines is that Maxwell scales almost linearly both with the number of cores in the processor, and also when you increase the number of render nodes in the farm. The graph below shows a test representing the performance speed obtained with different number of cores on a multi-core computer. The graph displays an unrivaled almost linear performance (close to the 100% percent theoretical limit). 

Test performed on a 32-cores Windows 2003 Server 64Bits reference computer


Below follows a general tips and best practices list for using Maxwell in a VFX environment.

General tips and optimizations

We strongly recommend to first of all read two short sections in our documentation which will help to avoid excessive render times and bad looking renders.

Installation and Licensing

The easiest way of installing Maxwell is through the installer (provided for Windows, Mac and Linux). The installer just copies a set of files and folders inside the installation folder chosen by the user and also in Windows and Linux it creates a new environment variable called MAXWELL3_ROOT which points to that folder.

To install Maxwell on many machines without running the installer in all of them it's possible to run the installer just in one node and then copy the Maxwell folder and set the MAXWELL3_ROOT environment variable to the rest of the machines.

  • In Windows, to add MAXWELL3_ROOT to your environment, open your system Properties panel (Control Panel>System) and enter the Advanced System Settings section. Among the Advanced settings you will find the Environment Variables panel. Maxwell needs a System Variable pointing to the Maxwell application folder, so in the System Variables list, hit New to create a new environment variable, name it MAXWELL3_ROOT, and in its value enter the path to your Maxwell 3 application folder. This will indicate your system when the Maxwell component are stored whenever it needed it.
  • In Linux, to add MAXWELL3_ROOT to your environment, assuming that you are using bash and maxwell is installed in /opt/local/maxwell-3.1, edit $HOME/.bash_profile and add this line:


export MAXWELL3_ROOT=/opt/local/maxwell-3.1


If you use csh or tcsh, edit $HOME/.cshrc and add this line:


setenv MAXWELL3_ROOT /opt/local/maxwell-3.1


It's also possible to write a system specific script that does the copying for you and adds the environment variables to each machine.


The installer also creates another environment variable called MAXWELL3_MATERIALS_DATABASE that points to the folder where the resources (material files, etc) installed with the package are located. This variable is not needed when running Maxwell in node mode.


More information about the installation process can be found here:

http://support.nextlimit.com/display/maxwelldocs/Installation

Licensing Maxwell

Maxwell 3 has, basically, two different license types: Node-Locked and Floating. Node-Locked are designed to be used on one computer only and once activated the license it gets tied to it. On the other hand, Floating licenses are served from one central computer and used from different computers connected to it in the network. 

More about licensing Maxwell is described here: Licensing

Network Rendering

The native Maxwell Network System

The Maxwell installation includes a native, easy and powerful Network System, which contains three components: Manager, Monitor and Rendernode. You can send a scene to render directly to network rendering from most of our Maxwell Render plugins.

It allows you to submit, queue and manage the following types of jobs: 

  • Single Job: for individual scenes. Each Rendernode takes one scene in the queue, and renders it independently until it finishes it, then takes the next job.
  • Animation Job: for animation sequences. A range of frames (MXS scene files) are submitted, and each Rendernode takes an individual frame, renders it independently until it finishes it, then takes the next frame in the sequence.
  • Cooperative Job: for individual scenes. Cooperative rendering is defined as the process of rendering the same image in several render nodes at the same time, each Rendernode renders the scene with a different seed value, producing MXI renders that are internally different (although they may look similar) that can then be merged into one cleaner file. Due to Maxwells almost linear scaling when rendering on several cores/computers, if you render on 10 computers with the same hardware, your render will finish practically 10x faster.

Connection to 3rd party job managers (Deadline, Rush, Qube, etc)

Maxwell can run as a command line application so its integration in 3rd party render managers is straight forward. Still, there are a few considerations that must be taken into account:

  • The “-nowait” flag forces Maxwell to exit once the render finishes. If this flag is not set the process will continue to be alive after the render is finished.
  • Exiting with a return code 0 means success, any other value means there has been an error (0: render successful, 1: critical error). 
  • The “-node” flag forces Maxwell to use a non GUI node license.
  • The “-norenderifdemo” flag forces Maxwell to stop a render if the node is unlicensed so it does not embed a watermark in the image or restricts the output resolution, but gets stopped before beginning.
  • In fact, even Cooperative Jobs (many computers working on the same frame) can be handled on a 3rd part job manager. To do this, we include a command line tool called Mximerge with the Maxwell package, created to merge the individual MXI files that each Rendernode produces during a network render, into one "final" MXI. Simply launch the same scene to be rendered on different Rendernodes (Maxwell will take care to assign a different seed to each render), gather all the MXI files they produced and call the Mximerge tool that will merge them together into a single and cleaner image. Type “mximerge –help” for more information about how to use this tool.

The full list of running flags and parameters can be found here: Command Line

Launching a Rendernode using command line

To launch Maxwell in command line mode using a node license instead of a full GUI, all that is needed is adding the –node flag to the arguments list

A note on installing Rendernodes on Linux (X11 and Xvfb) 

Due to 3rd part dependencies, Maxwell needs an X11 session running even in nongui mode. However there is a workaround that can be used to run Maxwell on machines with no display hardware and no physical input devices, using Xvfb (virtual framebuffer). More info on how to use Xvfb can be found here: Network FAQ

Special features

Resuming a render

Resuming a render means to refine an image you previously rendered, to a higher Sampling Level (thus getting a cleaner image). Maxwell can continue rendering at the same point where it was first stopped, so this way you can get a cleaner render without wasting your original render time.

To resume a render it is necessary that an MXI file (Maxwell Image file) exists, and the unaltered MXS scene file. This feature can be run with the Resume MXI tool in the Maxwell interface, or even can be enabled through a command line flag:

-resume:path where path is the MXI file path to resume

It is also possible to use the flag -trytoresume which resumes if the MXI output exists and if not, starts the render from the scratch without asking the user.

More info on command line flags can be found here in the online documentation or typing maxwell –help in a command line window.

MultiLight

Multilight is the ability to change light intensity (and optionally color in the Color MultiLight mode) in real time while rendering or once the render has finished. A full description of this acclaimed feature can be found here

Important: Multilight does not increase render times significantly, except the files generated are bigger so time to save to disk can be slower depending on the hardware performance. However Multilight increases the memory consumption linearly with the number of lights. It means if this feature is enabled, a render with 20 lights will need to allocate 20x more memory in image buffers than a render with one light. It is important in scenarios where the user does not want to adjust lights later, to disable MultiLlight from Render options or using the -multilight:off flag.

Specifically Color MultiLight needs even more memory than intensity MultiLight and should be used only when there is a real need of changing light colors after the render.


One important tip is to merge lights that you want to be controlled together, by applying the same emitter material to all geometry that you want to control using a single ML slider. This way you can still benefit from ML, but keep the memory usage to a minimum.

If resume rendering is not needed then the user might want to avoid the generation of big MXI files (with the -nomxi flag) and just enable the -extractlights flag to automatically save each light in a different image file. You can save these files in a high dynamic range format such as EXR. Also when lights are saved in separate files as HDR images and imported in a composition software such as Nuke, there is no need to enable Color MultiLight because the color of each light can be edited in composition separately.

Examples of setting a render via command line

Windows

> maxwell.exe -mxs:K:\scenes\test.mxs -o:K:\output\test.exr -multilight:on -nomxi -extractlights
OSX

> Maxwell.app/Contents/MacOS/Maxwell -mxs:~/scenes/test.mxs -o:~/scenes/output/test.exr -multilight:on -nomxi -extractlights
Linux

> maxwell -mxs:~/scenes/test.mxs -o:~/scenes/output/test.exr -multilight:on -nomxi -extractlights


File Management

As mentioned previously, MXI files can be very large depending on the resolution and whether MultiLight is enabled or not. In this case saving to disk can be time consuming. There are several options however to optimize this:

The "-mintime:X" flag

By default, Maxwell saves an MXI with each increment in the Sampling Level while rendering OR every 10 minutes, whichever comes first. While it's writing the file to disk, it has to pause rendering until the MXI has been written to disk and then resume the render. This can be time consuming for large MXI files, especially in the beginning of the render when the SL changes frequently. You can however override this behavior using the mintime:X flag, where X represents how often (in minutes) you wish to save the MXI. The maximum value is 180 minutes.

The "-nomxi" flag

If resume rendering or MXI merging are not necessary and there is no need of editing lights after the render, the flag “-nomxi” avoids saving the MXI file to disk and it saves instead only the image output you specified in Render Options.

The "-noimage" flag

This flag can be used to avoid also saving a standard image file format, which is useful if you want to save only MXI files which you can load directly in Nuke, After Effects or Photoshop with our MXI plugins. If MultiLight was turned on in Render Options, each light channel can be extracted from the MXI into a separate layer using these plugins, along with any other render channels (alpha, motion vector, z-depth etc.), so this can be an efficient workflow instead of having several files per frame which need importing.


Memory usage and trouble shooting

The main sources of memory consumption are:

  • Image buffers. Memory consumed is proportional to the output resolution, and if MultiLight is enabled it also grows linearly with the number of lights. As mentioned previously, the Color MultiLight option should be used only when strictly necessary.
  • Textures (number and size)
  • Geometry (incl. Hair / Grass)

When running out of memory the sources of memory consumption can be found following this process:

  1. Disable MultiLight if it was enabled and render at very low resolution (i.e 50x50 px). The difference between the memory consumed now and the memory consumed in the original render is the memory used to allocate image buffers.
  1. Render using a very simple override material. Doing this means no textures are used and it can be deduced how much texture memory was used originally.
  1. Pretty much all the memory not used in image buffers or textures is used for allocating memory structures.

Plug-ins

Every purchase of Maxwell Render includes for free all our plugins so you can easily work across multiple 3D and compositing applications (incl. After Effects, Nuke, Photoshop). There is a separate section for each plugin in the documentation - see the Plugins section for the full list.