Using a 3rd party job manager with Maxwell Render

Maxwell can run as a command line application so it can be controlled from any external process though command line flags. It allows you to connect it to any job manager in an standard way. The most typical scenario is rendering a single job or an animation. In that case the job manager just has to call maxwell using the following command line (be aware the paths could be different in each system):

> C:\program files\next limit\Maxwell 2\maxwell.exe \-scene:"D:\scenes\test.mxs" \-mxi:"D:\output\test.mxi" \-o:"D:\output\test.tiff" \-sl:15 \-res:1024x768 \-nogui \-nowait \-node

This command line instruction opens Maxwell Render and renders the scene “test.mxs” with the given sampling level and resolution and saves the output in the paths specified with the “-mxi” and the “-o” flags.

The flag “-nogui” forces Maxwell to run in console mode. The flag “-nowait” forces Maxwell to close after the render finishes. The flag “-node” forces Maxwell to use a node license instead a full license.

See the Command Line section for a full list of command line flags, or type:

> maxwell.exe \-help

in your command line window to learn more about Maxwell Render command line flags.

If the paths contain spaces they should be placed inside quotes as shown in the example.

To avoid typing the full path to the Maxwell executable in Windows every time, you can append it to the PATH environment variable. Typing “maxwell.exe” will work no matter where the current path is.

Maxwell Render can be killed from the job manager using any standard procedure to kill processes. When Maxwell Render receives a kill signal it stops the render, saves the output and closes.

Cooperative rendering

It is also possible to run cooperative renders (more than one machine rendering the same scene) through the command line.

To do so just follow these steps:

  1. Render as many images as you want, using a different seed in each one.The seed is initialized to a random value by Maxwell Render. It needs to be random in order for the MXI merging to work correctly.
  2. Merge the MXI output of all of them into one MXI file. To do so, use the mximerge tool included with the Maxwell Render package. For example, let’s say you have rendered ten MXI files that are in the folder D:\myproject\output.

To merge them just type:

> C:\program files\next limit\Maxwell 2\mximerge.exe \-folder:"D:\myproject\output\" \-target:"C:\merge_test.mxi" \-image:"C:\merge_test.png"

This command line instruction merges all the MXI files located in the folder “ D:\myproject\output\” into one “merge_test.mxi” and it also extracts the image and saves it in “C:\merge_test.png”

In cooperative rendering sometimes it is sometimes necessary to know the total sampling level that will result from merging individual MXI files. It can be calculated through the following formula:

A = exp( SL_MACHINE1 * log( 1.5 ) ) - 1.0
B = exp( SL_MACHINE2 * log( 1.5 ) ) - 1.0
C = ...

SL_MERGED = log( 1.0 + A + B + C + D + ...) / log( 1.5 )

Where log() is the base-e logarithm.

The opposite (estimating the individual sampling level of each render node when the total sampling level is known) is also possible:

double SL_LOCAL = ( log( ( (exp( SL_MERGED * log (1.5) ) - 1.0 ) / (double)nNodes ) + 1.0 )) / log(1.5);