Skip to main content
Version: 🚧 Nightly

Command line options

F3D behavior can be fully controlled from the command line using the following options.

Application Options

--input=<input file> (string)

The input file or files to read, can also be provided as a positional argument. Support directories as well.

--output=<png file> (string)

Instead of showing a render view and render into it, render directly into a png file. When used with --ref option, only outputs on failure. If - is specified instead of a filename, the PNG file is streamed to the stdout. Can use template variables.

--no-background (bool, default: false)

Use with --output to output a png file with a transparent background.

-h, --help

Print help and exit. Ignore --verbose.

--version

Show version information and exit. Ignore --verbose.

--list-readers

List available readers and exit. Ignore --verbose.

--force-reader=<reader> (string)

Force a specific reader to be used, disregarding the file extension.

--list-bindings

List available bindings and exit. Ignore --verbose.

--list-rendering-backends

List available rendering backends and exit. Ignore --verbose.

--config=<config file path/name/stem> (string, default: config)

Specify the configuration file to use. Supports absolute/relative path but also filename/filestem to search for in standard configuration file locations.

--no-config (bool, default: false)

Do not read any configuration file and consider only the command line options.

--no-render (bool, default: false)

Do not render anything and quit just after loading the first file, use with --verbose to recover information about a file.

--max-size=<size in MiB> (int, default: -1)

Prevent F3D to load a file bigger than the provided size in Mib, leave empty for unlimited, useful for thumbnails.

--watch (bool, default: false)

Watch current file and automatically reload it whenever it is modified on disk. Consider ensuring --remove-empty-file-groups is not enabled when using this option.

--frame-rate=<fps> (double, default: 30.0)

Frame rate used to refresh animation and other repeated tasks (watch, UI). Does not impact rendering frame rate.

--load-plugins=<paths or names> (string)

List of plugins to load separated with a comma. Official plugins are alembic, assimp, draco, hdf, occt, usd, vdb. See plugins for more info.

--scan-plugins

Scan standard directories for plugins and display their names, results may be incomplete. See plugins for more info.

--screenshot-filename=<png file> (string, default: {app}/{model}_{n}.png)

Filename to save screenshots to. Can use template variables. Supports relative paths as described.

--rendering-backend=<auto|egl|osmesa|glx|wgl> (string, default: auto)

Rendering backend to load, auto means to let F3D pick the correct one for you depending on your system capabilities. Use egl or osmesa on linux to force headless rendering.

-D, --define=<libf3d.option=value> (special)

A repeatable option to set libf3d and reader option manually. May trigger unexpected behavior.

-R, --reset=<libf3d.option> (special)

A repeatable option to reset libf3d options manually. Useful when overidding option set in configuration files.

General Options

--verbose=<[debug|info|warning|error|quiet]> (string, default: info)

Set verbose level, in order to provide more information about the loaded data in the output. If no level is provided, assume debug. Option parsing may ignore this flag.

--progress (bool, default: false)

Show a progress bar when loading the file.

--animation-progress (bool, default: false)

Show a progress bar when playing the animation.

--multi-file-mode=<single|all| dir> (string, default: single)

When opening multiple files, select if they should be shown all at once (all), one by one (single), or by directory (dir). Configuration files for all loaded files will be used in the order they are provided.

--multi-file-regex=<regex> (string)

Regular expression pattern to group files. Captured groups are replaced with * so that, for example, the pattern part(\d+) would group files foo-part1.xyz and foo-part2.xyz together as foo-part*.xyz.

--recursive-dir-add (bool, default: false)

When opening a directory, choose if they should be recursively added or not. If not, only the files in the provided directory will be added.

--remove-empty-file-groups (bool, default: false)

When loading a file group, if they results in an empty scene, remove the file group and load the next file group.

--up=<direction> (direction, default: +Y)

Define the Up direction.

-x, --axis (bool, default: false)

Show axes as a trihedron in the scene.

-g, --grid (bool, default: false)

Show a grid aligned with the horizontal (orthogonal to the Up direction) plane.

--grid-unit=<length> (double)

Set the size of the unit square for the grid. If not set (the default) a suitable value will be automatically computed.

--grid-subdivisions=<count> (int, default: 10)

Set the number of subdivisions for the grid.

--grid-color=<color> (color, default: 0,0,0)

Set the color grid lines.

--axes-grid (bool, default: false)

Show axes grid in the scene.

-e, --edges (bool, default: false)

Show the cell edges.

--armature (bool, default: false)

Show armature if present (glTF only).

--camera-index=<idx> (int)

Select the scene camera to use when available in the file. Automatically computed by default.

-k, --trackball (bool, default: false)

Enable trackball interaction.

--invert-zoom (bool, default: false)

Invert zoom direction with right mouse click.

--animation-autoplay (bool, default: false)

Automatically start animation.

--animation-indices=<idx1,idx2> (vector<int>, default: 0)

Select the animations to show. Any negative value all animations. The default scene always has at most one animation.

--animation-speed-factor=<ratio> (ratio, default: 1)

Set the animation speed factor to slow, speed up or even invert animation time.

--animation-time=<time> (double)

Set the animation time to load.

--font-file=<font file> (path)

Use the provided FreeType compatible font file to display text. Can be useful to display non-ASCII filenames.

--font-scale=<ratio> (ratio, default: 1.0)

Scale fonts. Useful for HiDPI displays.

--command-script=<command script> (script)

Provide a script file containing a list of commands to be executed sequentially. Allows automation of multiple commands or pre-defined tasks.

--backdrop-opacity=<opacity> (double, default: 0.9)

Set the opacity of the backdrop behind text information such as FPS, filename, metadata or cheatsheet.

Material options

-o, --point-sprites (bool, default: false)

Show sphere points sprites instead of the geometry.

--point-sprites-type=<sphere|gaussian> (string, default: sphere)

Set the splat type when showing point sprites.

--point-sprites-size=<size> (double, default: 10.0)

Set the size of point sprites.

--point-size=<size> (double)

Set the size of points when showing vertices. Model-specified by default.

--line-width=<size> (double)

Set the width of lines when showing edges. Model-specified by default.

--backface-type=<visible|hidden> (string)

Set the Backface type. Model-specified by default.

--color=<color> (color)

Set a color on the geometry. Multiplied with the base color texture when present. Model-specified by default.

--opacity=<opacity> (double)

Set opacity on the geometry. Multiplied with the base color texture when present. Model-specified by default. Usually used with --translucency-support.

--roughness=<roughness> (double)

Set the roughness coefficient on the geometry (0.0-1.0). Multiplied with the material texture when present. Model-specified by default.

--metallic=<metallic> (double)

Set the metallic coefficient on the geometry (0.0-1.0). Multiplied with the material texture when present. Model-specified by default.

--base-ior=<base-ior> (double)

Set the index of refraction of the base layer (1.0-2.5). Model-specified by default.

--hdri-file=<HDRI file> (path)

Set the HDRI image that can be used as ambient lighting and skybox. Valid file format are .hdr, .exr, .png, .jpg, .pnm, .tiff, .bmp. If not set, a default is provided.

--hdri-ambient (string)

Light the scene using the HDRI image as ambient lighting. The environment act as a light source and is reflected on the material.

--texture-matcap=<texture file> (path)

Set the texture file to control the material capture of the object. All other model options for surfaces are ignored if this is set. Must be in linear color space. Model-specified by default.

--texture-base-color=<texture file> (path)

Set the texture file to control the color of the object. Please note this will be multiplied with the color and opacity options. Must be in sRGB color space. Model-specified by default.

--texture-material=<texture file> (path)

Set the texture file to control the occlusion, roughness and metallic values of the object. Please note this will be multiplied with the roughness and metallic options, which have impactful default values. To obtain true results, use --roughness=1 and --metallic=1. Must be in linear color space. Model-specified by default.

--texture-emissive=<texture file> (path)

Set the texture file to control the emitted light of the object. Please note this will be multiplied with the emissive factor. Must be in sRGB color space. Model-specified by default.

--emissive-factor=<color> (color)

Set the emissive factor. This value is multiplied with the emissive color when an emissive texture is present. Model-specified by default.

--texture-normal=<texture file> (path)

Set the texture file to control the normal map of the object. Must be in sRGB color space. Model-specified by default.

--normal-scale=<color> (double)

Set the normal scale. This value affects the strength of the normal deviation from the normal texture. Model-specified by default.

--textures-transform=<transform2d> (transform2d)

Set the 2d transform to use for all textures applied to the model. Importer may set a default value depending on file type. If a default value exists, the default value is multiplied by the provided transform.

Window options

--background-color=<color> (color, default: 0.2, 0.2, 0.2)

Set the window background color. Ignored if --hdri-skybox is enabled.

--resolution=<width,height> (vector<double>, default: 1000, 600)

Set the window resolution.

--position=<x,y> (vector<double>)

Set the window position (top left corner) , in pixels, starting from the top left of your screens.

-z, --fps (bool, default: false)

Display a rendering frame per second counter.

-n, --filename (bool, default: false)

Display the name of the file on top of the window.

-m, --metadata (bool, default: false)

Display the metadata.

--hdri-skybox (bool, default: false)

Show the HDRI as a skybox. Overrides --background-color and --no-background.

-u, --blur-background (bool, default: false)

Blur background. Useful with a HDRI skybox.

--blur-coc (double, default: 20)

Blur circle of confusion radius.

--light-intensity (double, default: 1.0)

Adjust the intensity of every light in the scene.

Scientific visualization options

-s, --scalar-coloring (bool, default: false)

Enable scalar coloring if present in the file. If --coloring-array is not set, the first in alphabetical order will be picked if any are available.

--coloring-array=<array_name> (string)

The coloring array name to use when coloring. Use --verbose to recover the usable array names.

-y, --comp=<comp_index> (int, default: -1)

Specify the component from the scalar array to color with. Use with the scalar option. -1 means magnitude. -2 or the short option, -y, means direct values. When using direct values, components are used as L, LA, RGB, RGBA values depending on the number of components.

-c, --cells (bool, default: false)

Specify that the scalar array is to be found on the cells instead of on the points. Use with the scalar option.

--range=<min,max> (vector<double>)

Set the coloring range. Automatically computed by default. Use with the scalar option.

-b, --bar (bool, default: false)

Show scalar bar of the coloring by array. Use with the scalar option.

--colormap-file=<name> (string)

Set a colormap file for the coloring. See color maps. Use with the scalar option.

--colormap=<colormap> (colormap)

Set a custom colormap for the coloring.See colormap parsing for details. Ignored if --colormap-file option is specified. Use with the scalar option.

--colormap-discretization=<colors> (int)

Set the number of distinct colors from [1, N] will be used in the colormap. Any values outside the valid range will result in smooth shading.

-v, --volume (bool, default: false)

Enable volume rendering. It is only functional for 3D image data (VTKXMLVTI, DICOM, NRRD, MetaImage files) and will display nothing with other formats. It forces coloring.

-i, --inverse (bool, default: false)

Inverse the linear opacity function used for volume rendering.

Camera configuration options

--camera-position=<X,Y,Z> (vector<double>)

Set the camera position, overrides --camera-direction and --camera-zoom-factor.

--camera-focal-point=<X,Y,Z> (vector<double>)

Set the camera focal point.

--camera-view-up=<direction> (direction)

Set the camera view up vector. Will be orthogonalized.

--camera-view-angle=<angle> (double)

Set the camera view angle, a strictly positive value in degrees.

--camera-direction=<direction> (direction)

Set the camera direction, looking at the focal point.

--camera-zoom-factor=<factor> (double)

Set the camera zoom factor relative to the autozoom on data, a strictly positive value.

--camera-azimuth-angle=<angle> (double, default: 0.0)

Apply an azimuth transformation to the camera, in degrees, added after other camera options.

--camera-elevation-angle=<angle> (double, default: 0.0)

Apply an elevation transformation to the camera, in degrees, added after other camera options.

--camera-orthographic (bool)

Set the camera to use the orthographic projection. Model-specified by default.

Raytracing options

-r, --raytracing (bool, default: false)

Enable OSPRay raytracing. Requires OSPRay raytracing to be enabled in the linked VTK dependency.

--samples=<samples> (int, default: 5)

Set the number of samples per pixel when using raytracing.

-d, --denoise (bool, default: false)

Denoise the image when using raytracing.

PostFX (OpenGL) options

-p, --translucency-support (bool, default: false)

Enable translucency support. This is a technique used to correctly render translucent objects.

-q, --ambient-occlusion (bool, default: false)

Enable ambient occlusion. This is a technique used to improve the depth perception of the object.

-a, --anti-aliasing (bool, default: false)

Enable anti-aliasing. This technique is used to reduce aliasing.

--anti-aliasing-mode (string, default: fxaa)

Anti-aliasing method (fxaa: fast, ssaa: quality, taa: balanced)

warning

taa forces rendering of the scene at regular interval and will introduce ghosting artifacts on animated scenes. It also doesn't work with offscreen rendering (when using --output option)

-t, --tone-mapping (bool, default: false)

Enable generic filmic Tone Mapping Pass. This technique is used to map colors properly to the monitor colors.

--final-shader (string)

Add a final shader to the output image. See the dedicated documentation for more details.

Testing options

--ref=<png file> (string)

Render and compare with the provided reference image, for testing purposes. Use with output option to generate new baselines and diff images.

--ref-threshold=<threshold> (double, default: 0.04)

Set the comparison threshold to trigger a test failure or success. The default (0.04) correspond to almost visually identical images.

--interaction-test-record=<log file> (string)

Path to an interaction log file to record interaction events to.

--interaction-test-play=<log file> (string)

Path to an interaction log file to play interactions events from when loading a file.

Rendering options precedence

Some rendering options are not compatible between them, here is the precedence order if several are provided:

  • Raytracing (-r)
  • Volume (-v)
  • Point Sprites (-o)

Options syntax

To turn on/off boolean options, it is possible to write --option=true and --option=false, eg --points-sprites=false.

As documented, the --option=value syntax should be preferred. The syntax --option value can have unintended effect with positional arguments.

The -R short option has a special syntax: -Rlibf3d.option but can also be used with --reset=libf3d.option

The -D/--define option has a special syntax: -Dlibf3d.option=value or --define=libf3d.option=value.

All options are parsed according to their type, see the parsing documentation for more details.

Filename templating

The destination filename used by --output or to save screenshots using --screenshot-filename can use the following template variables:

  • {app}: application name (ie. F3D)
  • {version}: application version (eg. 2.4.0)
  • {version_full}: full application version (eg. 2.4.0-abcdefgh)
  • {model}: current model filename without extension (eg. foo for /home/user/foo.glb)
  • {model.ext}: current model filename with extension (eg. foo.glb for /home/user/foo.glb)
  • {model_ext}: current model filename extension (eg. glb for /home/user/foo.glb)
  • {date}: current date in YYYYMMDD format
  • {date:format}: current date as per C++'s std::put_time format
  • {n}: auto-incremented number to make filename unique (up to 1000000)
  • {n:2}, {n:3}, ...: zero-padded auto-incremented number to make filename unique (up to 1000000)
  • variable names can be escaped by doubling the braces (eg. use {{model}}.png to output {model}.png without the model name being substituted)

For example the screenshot filename is configured as {app}/{model}_{n}.png by default, meaning that, assuming the model hello.glb is being viewed, consecutive screenshots are going to be saved as F3D/hello_1.png, F3D/hello_2.png, F3D/hello_3.png, ...

Model related variables will be replaced by no_file if no file is loaded and multi_file if multiple files are loaded using the multi-file-mode option.

HDRI Caches

When using HDRI related options, F3D will create and use a cache directory to store related data in order to speed up rendering. These cache files can be safely removed at the cost of recomputing them on next use.

The cache directory location is as follows, in order, using the first defined environment variables:

  • Windows: %LOCALAPPDATA%\f3d
  • Linux: ${XDG_CACHE_HOME}/f3d,${HOME}/.cache/f3d
  • macOS: ${HOME}/Library/Caches/f3d