Headless Rendering

This article describes how to render scenes with Chunky using the command-line interface in Headless mode (no GUI).

Chunky Launcher
When working with Chunky from the command line, you must be aware of what the Chunky launcher does. The launcher is bundled with Chunky since version 1.2.0 and it is responsible for actually launching Chunky by spawning a new Java process, so any JVM options (memory limit etc.) you use when invoking the launcher do not apply the the actual Chunky process. JVM options for Chunky can be changed by editing the launcher settings file ~/.chunky/chunky-launcher.json.

If you send any command line arguments to the launcher it will assume that Chunky should run in headless mode, unless the --nolauncher option is given in which case Chunky is started regularly, but without showing the launcher window. The --launcher option overrides everything else and forces the launcher to appear.

Headless Rendering
It is possible to render a scene from the command line. First set up a scene using the GUI. Don't forget to save the scene. Then run the following on the command line:

java -jar ChunkyLauncher.jar -render SceneName

Where SceneName is the name of the scene to render. When run this way Chunky will not shut down when the rendering has met the target SPP of the scene. You can press Ctrl-C to force Chunky to quit prematurely. The renders will be saved periodically in the scene directory, depending on the render dump setting for the scene.

If you wish to override the SPP target for the scene, you can do so using the -target option:

java -jar ChunkyLauncher.jar -render SceneName -target 9001

The scene directory can be specified using the -scene-dir option:

java -jar ChunkyLauncher.jar -render SceneName -scene-dir path/to/my/SceneDir

Rendering on a Server
Let's say the name of the scene you want to render on your server is Bork.


 * 1) If you don't have a Minecraft client installed on the server, create a directory $HOME/.minecraft and put the latest minecraft.jar there (this is required for certain textures to render properly irrespective of the texture pack used)
 * 2) Create a scene directory on your server, let's say it has the path $HOME/SceneDir
 * 3) Copy all scene files from your local machine into the remote scene directory. You must copy the files Bork.json, Bork.octree, Bork.grass and Bork.foliage.
 * 4) Run chunky with a command such as java -jar Chunky.jar -scene-dir $HOME/SceneDir -render Bork
 * 5) Hit Ctrl-C to halt rendering at some point. This will only leave the last render dump so be careful that you have configured Chunky to save render dumps regularly.
 * 6) If the scene was configured to save snapshots for each dump then the rendered images should be in $HOME/SceneDir. If the scene was rendered to completion then the final rendered image is output to that same directory.