Skip to main content
Version: 🚧 Nightly

Options

An option is a specific value stored in different struct in an options instance. They can be accessed directly through the structs, through a string API or through a std::variant API.

The possible option are listed below and are organized by categories and subcategories, here is a non-exhaustive explanation of the categories.

  • scene options are related to how the scene is being displayed
  • render options are related to the way the render is done
  • render.effect options are related to specific techniques used that modify the render
  • ui options are related to the screenspace UI element displayed
  • model options are related to modifications on the model
  • interactor options requires an interactor to be present to have any effect

Please note certain options are taken into account when rendering, others when loading a file. See the exhaustive list below, but note that this may change in the future.

Please note certain options are optional by default, which means they are not set initially, See the APIs details below for more info.

Scene Options

OptionType
Default
Trigger
DescriptionF3D option
scene.animation.autoplaybool
false
load
Automatically start animation.--animation-autoplay
scene.animation.indicesvector<int>
0
load
Select the animations to load.
Any negative value means all animations.
The default scene always has at most one animation.
--animation-indices
scene.animation.speed_factorratio
1
render
Set the animation speed factor to slow, speed up or even invert animation.--animation-speed-factor
scene.animation.timedouble
optional
load
Set the animation time to load.--animation-time
scene.camera.indexint
optional
load
Select the scene camera to use when available in the file.
The default scene always uses automatic camera.
--camera-index
scene.up_directiondirection
+Y
load
Define the Up direction. It impacts the grid, the axis, the HDRI and the camera.--up
scene.force_readerstring
optional
load
Force a specific reader to be used, disregarding the file extension. See user documentation--force-reader
scene.camera.orthographicbool
optional
load
Set to true to force orthographic projection. Model specified by default, which is false if not specified.--camera-orthographic

Interactor Options

OptionType
Default
Trigger
DescriptionF3D option
interactor.trackballbool
false
render
Enable trackball interaction.--trackball
interactor.invert_zoombool
false
render
Invert the zoom direction.--invert-zoom

Model Options

OptionType
Default
Trigger
DescriptionF3D option
model.matcap.texturepath
optional
render
Path to a texture file containing a material capture. All other model options for surfaces are ignored if this is set. Model specified by default.--texture-matcap
model.color.opacitydouble
optional
render
Set opacity on the geometry. Usually used with Depth Peeling option. Multiplied with the model.color.texture when present. Model specified by default.--opacity
model.color.rgbcolor
optional
render
Set a color on the geometry. Multiplied with the model.color.texture when present. Model specified by default.--color
model.color.texturepath
optional
render
Path to a texture file that sets the color of the object. Will be multiplied with rgb and opacity. Model specified by default.--texture-base-color
model.emissive.factorcolor
optional
render
Multiply the emissive color when an emissive texture is present. Model specified by default.--emissive-factor
model.emissive.texturepath

render
Path to a texture file that sets the emitted light of the object. Multiplied with the model.emissive.factor. Model specified by default.--texture-emissive
model.material.metallicdouble
optional
render
Set the metallic coefficient on the geometry (0.0-1.0). Multiplied with the model.material.texture when present. Model specified by default.--metallic
model.material.roughnessdouble
optional
render
Set the roughness coefficient on the geometry (0.0-1.0). Multiplied with the model.material.texture when present. Model specified by default.--roughness
model.material.base_iordouble
optional
render
Set the index of refraction of the base layer (1.0-2.5). Model specified by default.--base-ior
model.material.texturepath
optional
render
Path to a texture file that sets the Occlusion, Roughness and Metallic values of the object. Multiplied with the model.material.roughness and model.material.metallic, set both of them to 1.0 to get a true result. Model specified by default.--texture-material
model.normal.scaledouble
optional
render
Normal scale affects the strength of the normal deviation from the normal texture. Model specified by default.--normal-scale
model.normal.texturepath
optional
render
Path to a texture file that sets the normal map of the object. Model specified by default.--texture-normal
model.scivis.enablebool
false
render
Color by an array present in on the data. If model.scivis.array_name is not set, the first available array will be used.--scalar-coloring
model.scivis.cellsbool
false
render
Color the data with value found on the cells instead of points--cells
model.scivis.discretizationint
optional
render
Set how many distinct colors will be used from the colormap. [1, N] will discretize, values outside that range will result in smooth shading.--colormap-discretization
model.scivis.colormapcolormap
<inferno>
render
Set a custom colormap for the coloring.See colormap parsing for details.--colormap
model.scivis.componentint
-1
render
Specify the component to color with. -1 means magnitude. -2 means direct values.--comp
model.scivis.array_namestring

render
Select the name of the array to color with.--coloring-array
model.scivis.rangevector<double>
optional
render
Set the coloring range. Automatically computed by default.--range
model.point_sprites.enablebool
false
render
Show sphere points sprites instead of the geometry.--point-sprites
model.point_sprites.typestring
sphere
render
Set the sprites type when showing point sprites (can be sphere or gaussian).--point-stripes-type
model.point_sprites.sizedouble
10.0
render
Set the size of point sprites.--point-stripes-size
model.volume.enablebool
false
render
Enable volume rendering. It is only available for 3D image data (vti, dcm, nrrd, mhd files) and will display nothing with other formats. It forces coloring.--volume
model.volume.inversebool
false
render
Inverse the linear opacity function.--inverse
model.textures_transformtransform2d
optional
render
Transform applied to textures on the model. If a default transform is set by the importer, the default value will be multiplied by this transform.--textures-transform

Render Options

OptionType
Default
Trigger
DescriptionF3D option
render.effect.translucency_supportbool
false
render
Enable translucency support. This is a technique used to correctly render translucent objects, implemented using depth peeling--translucency-support
render.effect.antialiasing.enablestring
false
render
Enable anti-aliasing. This technique is used to reduce aliasing.--anti-aliasing
render.effect.antialiasing.modestring
fxaa
render
Set the anti-aliasing technique. Valid options are: FXAA (fast), SSAA (quality)--anti-aliasing-mode
render.effect.ambient_occlusionbool
false
render
Enable ambient occlusion. This is a technique providing approximate shadows, used to improve the depth perception of the object. Implemented using SSAO--ambient_occlusion
render.effect.tone_mappingbool
false
render
Enable generic filmic Tone Mapping Pass. This technique is used to map colors properly to the monitor colors.--tone-mapping
render.effect.final_shaderstring
optional
render
Add a final shader to the output image--final-shader. See user documentation.
render.line_widthdouble
optional
render
Set the width of lines when showing edges. Model specified by default.--line-width
render.show_edgesbool
optional
render
Set to true to show the cell edges. Model specified by default.--edges
render.point_sizedouble
optional
render
Set the size of points when showing vertices. Model specified by default.--point-size
render.backface_typestring
optional
render
Set the Backface type, can be visible or hidden, model specified by default.--backface-type
render.grid.enablebool
false
render
Show a grid aligned with the horizontal (orthogonal to the Up direction) plane.--grid
render.grid.absolutebool
false
render
Position the grid at the absolute origin of the model's coordinate system instead of below the model.--grid
render.grid.unitdouble
optional
render
Set the size of the unit square for the grid. Automatically computed by default.--grid-unit
render.grid.subdivisionsint
10
render
Set the number of subdivisions for the grid.--grid-subdivisions
render.grid.colorcolor
0, 0, 0
render
Set the color of grid lines.--grid-color
render.raytracing.enablebool
false
render
Enable raytracing. Requires the raytracing module to be enabled.--raytracing
render.raytracing.samplesint
5
render
The number of samples per pixel.--samples
render.raytracing.denoisebool
false
render
Denoise the raytracing rendering.--denoise
render.hdri.filepath
optional
render
Set the HDRI image that can be used for ambient lighting and skybox.
Valid file format are hdr, exr, png, jpg, pnm, tiff, bmp.
If not set, a default is provided.
--hdri-file
render.hdri.ambientbool
false
render
Light the scene using the HDRI image as ambient lighting
The environment act as a light source and is reflected on the material.
--hdri-ambient
render.background.colorcolor
0.2,0.2,0.2
render
Set the window background color.
Ignored if a hdri skybox is used.
--background-color
render.background.skyboxbool
false
render
Show the HDRI image as a skybox
Overrides the the background color if any
--hdri-skybox
render.background.blur.enablebool
false
render
Blur background, useful with a skybox.--blur-background
render.background.blur.cocdouble
20.0
render
Blur background circle of confusion radius.--blur-coc
render.light.intensitydouble
1.0
render
Adjust the intensity of every light in the scene.--light-intensity
render.armature.enablebool
false
render
Display armatures if present in the scene (glTF only).--armature

UI Options

OptionType
Default
Trigger
DescriptionF3D option
ui.axisbool
false
render
Show axes as a trihedron in the scene. Requires an interactor.--axis
ui.scalar_barbool
false
render
Show scalar bar of the coloring by data array.--bar
ui.cheatsheetbool
false
render
Show a interaction cheatsheet-
ui.consolebool
false
render
Show the console-
ui.minimal_consolebool
false
render
Show the minimal console. Useful to execute a quick command and exit.-
ui.filenamebool
false
render
Display the filename info content on top of the window.--filename
ui.filename_infostring
-
render
Content of filename info to display.-
ui.font_filepath
optional
render
Use the provided FreeType compatible font file to display text.
Can be useful to display non-ASCII filenames.
--font-file
ui.scaleratio
1.0
render
Scale fonts.--font-scale
ui.fpsbool
false
render
Display a frame per second counter.--fps
ui.loader_progressbool
false
load
Show a progress bar when loading the file.--progress
ui.animation_progressbool
false
load
Show a progress bar when playing the animation.--animation-progress
ui.metadatabool
false
render
Display the metadata.--metadata
ui.drop_zone.enablebool
false
render
Show a drop zone. Rendering is disabled when the viewport is smaller than 10×10 pixels.-
ui.drop_zone.custom_bindsstring
-
render
Space separated custom key bindings to display in the drop zone.-
ui.drop_zone.show_logobool
false
render
Display the logo. Needs ui.drop_zone.enable to be true.-
ui.backdrop.opacitydouble
0.9
render
Set the opacity of the backdrop behind the UI elements. Value is between 0.0 (fully transparent) and 1.0 (fully opaque).--backdrop-opacity

APIs

There are three APIs to access the options

Struct API

The most straightforward and easy to use API, just access it through the structs available in the options instance, eg:

  f3d::engine eng = f3d::engine::create();
f3d::options& opt = eng.getOptions();
opt.render.show_edges = true;
opt.render.grid.enable = true;
opt.ui.metadata = true;
opt.model.material.roughness = 0.6;

Please note that when accessing optional options, special care must be used, eg:

  f3d::engine eng = f3d::engine::create();
f3d::options& opt = eng.getOptions();
if (opt.render.line_width.has_value())
{
std::cout << "Line Width: " << opt.render.line_width.value() << "\n";
}
else
{
std::cout << "Line Width: unset\n";
}

It's even more true with the few optional boolean options as std::optional has an implicit boolean cast operator.

String API

The most generic and flexible API, as it rely on parsing and string generation. See the parsing documentation for more details.

  f3d::engine eng = f3d::engine::create();
f3d::options& opt = eng.getOptions();
opt.setAsString("render.show_edges", "true");
opt.setAsString("render.grid.enable", "true");
opt.setAsString("ui.metadata", "true");
opt.setAsString("model.material.roughness", "0.6");

When using this API make sure to catch exceptions has needed, eg:

  f3d::engine eng = f3d::engine::create();
f3d::options& opt = eng.getOptions();

try
{
std::cout << userProvidedName << ": " << opt.getAsString(userProvidedName) << "\n";
}
catch (const f3d::options::inexistent_exception&)
{
std::cout << userProvidedName << " does not exist.\n";
}
catch (const f3d::options::no_value_exception&)
{
std::cout << userProvidedName << " is not set.\n";
}

Variant API

An API that is similar to the F3D 2.0 options API thanks to std::variant.

  f3d::engine eng = f3d::engine::create();
f3d::options& opt = eng.getOptions();
opt.set("render.show_edges", true);
opt.set("render.grid.enable", true);
opt.set("ui.metadata", true);
opt.set("model.material.roughness", 0.6);

When using this API make sure to catch exception shown above with the string API.