From b63ad85b2a11c052f90ffcc31fd93230ea51a0ad Mon Sep 17 00:00:00 2001 From: Mathieu Westphal Date: Sat, 21 Dec 2024 19:38:40 +0100 Subject: [PATCH] Add PARSING documentation Add correct types to libf3d options doc Adding types to OPTIONS.md Adding doc clfi --- _config.yml | 17 +++- doc/libf3d/OPTIONS.md | 14 +-- doc/user/COMMANDS.md | 1 + doc/user/OPTIONS.md | 202 ++++++++++++++++++++-------------------- doc/user/PARSING.md | 58 ++++++++++++ doc/user/QUICKSTART.md | 1 + doc/user/README_USER.md | 1 + 7 files changed, 182 insertions(+), 112 deletions(-) create mode 100644 doc/user/PARSING.md diff --git a/_config.yml b/_config.yml index dfa4cde6e8..0e27ad0d93 100644 --- a/_config.yml +++ b/_config.yml @@ -134,39 +134,46 @@ defaults: - scope: - path: "doc/user/COLOR_MAPS.md" + path: "doc/user/PARSING.md" values: parent: User Documentation nav_order: 8 - scope: - path: "doc/user/FINAL_SHADER.md" + path: "doc/user/COLOR_MAPS.md" values: parent: User Documentation nav_order: 9 - scope: - path: "doc/user/DESKTOP_INTEGRATION.md" + path: "doc/user/FINAL_SHADER.md" values: parent: User Documentation nav_order: 10 - scope: - path: "doc/user/PLUGINS.md" + path: "doc/user/DESKTOP_INTEGRATION.md" values: parent: User Documentation nav_order: 11 + - + scope: + path: "doc/user/PLUGINS.md" + values: + parent: User Documentation + nav_order: 12 + - scope: path: "doc/user/LIMITATIONS_AND_TROUBLESHOOTING.md" values: title: Limitations and Troubleshooting parent: User Documentation - nav_order: 12 + nav_order: 13 # libf3d doc - diff --git a/doc/libf3d/OPTIONS.md b/doc/libf3d/OPTIONS.md index 3e04f64476..e9ad682331 100644 --- a/doc/libf3d/OPTIONS.md +++ b/doc/libf3d/OPTIONS.md @@ -24,7 +24,7 @@ Option|Type
Default
Trigger|Description|F3D option :---:|:---:|:---|:---: scene.animation.autoplay|bool
false
load|Automatically start animation.|\-\-animation-autoplay scene.animation.index|int
0
load|Select the animation to load.
Any negative value means all animations (glTF only).
The default scene always has at most one animation.|\-\-animation-index -scene.animation.speed_factor|double
1
render|Set the animation speed factor to slow, speed up or even invert animation.|\-\-animation-speed-factor +scene.animation.speed_factor|ratio
1
render|Set the animation speed factor to slow, speed up or even invert animation.|\-\-animation-speed-factor scene.animation.time|double
optional
load|Set the animation time to load.|\-\-animation-time scene.camera.index|int
optional
load|Select the scene camera to use when available in the file.
The default scene always uses automatic camera.|\-\-camera-index scene.up_direction|string
+Y
load|Define the Up direction. It impacts the grid, the axis, the HDRI and the camera.|\-\-up @@ -43,9 +43,9 @@ Option|Type
Default
Trigger|Description|F3D option :---:|:---:|:---|:---: model.matcap.texture|string
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.opacity|double
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.rgb|vector\
optional
render|Set a *color* on the geometry. Multiplied with the `model.color.texture` when present. Model specified by default.|\-\-color +model.color.rgb|double_vector
optional
render|Set a *color* on the geometry. Multiplied with the `model.color.texture` when present. Model specified by default.|\-\-color model.color.texture|string
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.factor|vector\
optional
render| Multiply the emissive color when an emissive texture is present. Model specified by default.|\-\-emissive-factor +model.emissive.factor|double_vector
optional
render| Multiply the emissive color when an emissive texture is present. Model specified by default.|\-\-emissive-factor model.emissive.texture|string

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.metallic|double
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.roughness|double
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 @@ -54,10 +54,10 @@ model.normal.scale|double
optional
render|Normal scale affects the strengt model.normal.texture|string
optional
render|Path to a texture file that sets the normal map of the object. Model specified by default.|\-\-texture-normal model.scivis.enable|bool
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.cells|bool
false
render|Color the data with value found *on the cells* instead of points|\-\-cells -model.scivis.colormap|vector\
\
render|Set a *custom colormap for the coloring*.
This is a list of colors in the format `val1,red1,green1,blue1,...,valN,redN,greenN,blueN`
where all values are in the range (0,1).|\-\-colormap +model.scivis.colormap|double_vector
\
render|Set a *custom colormap for the coloring*.
This is a list of colors in the format `val1,red1,green1,blue1,...,valN,redN,greenN,blueN`
where all values are in the range (0,1).|\-\-colormap model.scivis.component|int
-1
render|Specify the component to color with. -1 means *magnitude*. -2 means *direct values*.|\-\-comp model.scivis.array_name|string

render|Select the name of the array to color with.|\-\-coloring-array -model.scivis.range|vector\
optional
render|Set the *coloring range*. Automatically computed by default.|\-\-range +model.scivis.range|double_vector
optional
render|Set the *coloring range*. Automatically computed by default.|\-\-range model.point_sprites.enable|bool
false
render|Show sphere *points sprites* instead of the geometry.|\-\-point-sprites model.point_sprites.type|string
sphere
render|Set the sprites type when showing point sprites (can be `sphere` or `gaussian`).|\-\-point-stripes-type model.point_sprites.size|double
10.0
render|Set the *size* of point sprites.|\-\-point-stripes-size @@ -87,7 +87,7 @@ render.raytracing.samples|int
5
render|The number of *samples per pixel*.| render.raytracing.denoise|bool
false
render|*Denoise* the raytracing rendering.|\-\-denoise render.hdri.file|string
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.ambient|bool
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.color|vector\
0.2,0.2,0.2
render|Set the window *background color*.
Ignored if a *hdri* skybox is used.|\-\-background-color +render.background.color|double_vector
0.2,0.2,0.2
render|Set the window *background color*.
Ignored if a *hdri* skybox is used.|\-\-background-color render.background.skybox|bool
false
render|Show the *HDRI* image as a skybox
Overrides the the background color if any|\-\-hdri-skybox render.background.blur.enable|bool
false
render|Blur background, useful with a skybox.|\-\-blur-background render.background.blur.coc|double
20.0
render|Blur background circle of confusion radius.|\-\-blur-coc @@ -148,7 +148,7 @@ It's even more true with the few optional boolean options as std::optional has a ## String API The most generic and flexible API, as it rely on parsing and string generation. -The documentation about option parsing is upcoming. +See the [parsing documentation](../user/PARSING.md) for more details. ```cpp f3d::engine eng = f3d::engine::create(); diff --git a/doc/user/COMMANDS.md b/doc/user/COMMANDS.md index 2f237f0c63..d3942a6324 100644 --- a/doc/user/COMMANDS.md +++ b/doc/user/COMMANDS.md @@ -111,3 +111,4 @@ Command syntax is similar to bash, as in they will be split by "token" to be pro - Other escaped character will be processed as if the escape was not present, eg: `set scene.up.direction +\Z` - Unfinished quoted section is invalid, eg: `set scene.up.direction "+Z` - A escape at the end is also invalid, eg: `set scene.up.direction +Z\` + - Options values are [parsed](PARSING.md) according to their types. diff --git a/doc/user/OPTIONS.md b/doc/user/OPTIONS.md index 7dc9788579..72401e6340 100644 --- a/doc/user/OPTIONS.md +++ b/doc/user/OPTIONS.md @@ -6,141 +6,141 @@ F3D behavior can be fully controlled from the command line using the following o ## Application Options -Options|Default|Description +Options|Type
Default|Description ------|------|------ -\-\-input=\||The input file or files to read, can also be provided as a positional argument. -\-\-output=\||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](#filename-templating). -\-\-no-background||Use with \-\-output to output a png file with a transparent background. +\-\-input=\|string
-|The input file or files to read, can also be provided as a positional argument. +\-\-output=\|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](#filename-templating). +\-\-no-background|bool
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`. \-\-readers-list||List available *readers* and exit. Ignore `--verbose`. -\-\-config=\|config|Specify the [configuration file](CONFIGURATION_FILE.md) to use. Supports absolute/relative path but also filename/filestem to search for in standard configuration file locations. -\-\-dry-run||Do not read any configuration file and consider only the command line options. -\-\-no-render||Do not render anything and quit just after loading the first file, use with \-\-verbose to recover information about a file. -\-\-max-size=\|-1|Prevent F3D to load a file bigger than the provided size in Mib, negative value means unlimited, useful for thumbnails. -\-\-watch||Watch current file and automatically reload it whenever it is modified on disk. -\-\-frame-rate=\|30.0|Frame rate used to refresh animation and other repeated tasks (watch, UI). Does not impact rendering frame rate. -\-\-load-plugins=\||List of plugins to load separated with a comma. Official plugins are `alembic`, `assimp`, `draco`, `exodus`, `occt`, `usd`, `vdb`. See [plugins](PLUGINS.md) for more info. +\-\-config=\|string
config|Specify the [configuration file](CONFIGURATION_FILE.md) to use. Supports absolute/relative path but also filename/filestem to search for in standard configuration file locations. +\-\-dry-run|bool
false|Do not read any configuration file and consider only the command line options. +\-\-no-render|bool
false|Do not render anything and quit just after loading the first file, use with \-\-verbose to recover information about a file. +\-\-max-size=\|int
-1|Prevent F3D to load a file bigger than the provided size in Mib, negative value means unlimited, useful for thumbnails. +\-\-watch|bool
false|Watch current file and automatically reload it whenever it is modified on disk. +\-\-frame-rate=\|double
30.0|Frame rate used to refresh animation and other repeated tasks (watch, UI). Does not impact rendering frame rate. +\-\-load-plugins=\|string
-|List of plugins to load separated with a comma. Official plugins are `alembic`, `assimp`, `draco`, `exodus`, `occt`, `usd`, `vdb`. See [plugins](PLUGINS.md) for more info. \-\-scan-plugins||Scan standard directories for plugins and display their names, results may be incomplete. See [plugins](PLUGINS.md) for more info. -\-\-screenshot-filename=\|`{app}/{model}_{n}.png`|Filename to save [screenshots](INTERACTIONS.md#taking-screenshots) to. Can use [template variables](#filename-templating). -\-\-rendering-backend=\|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. +\-\-screenshot-filename=\|string
`{app}/{model}_{n}.png`|Filename to save [screenshots](INTERACTIONS.md#taking-screenshots) to. Can use [template variables](#filename-templating). +\-\-rendering-backend=\|string
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. ## General Options -Options|Default|Description +Options|Type
Default|Description ------|------|------ -\-\-verbose=\<[debug\|info\|warning\|error\|quiet]\>|info| Set *verbose* level, in order to provide more information about the loaded data in the console output. If no level is provided, assume `debug`. Option parsing may ignore this flag. -\-\-progress||Show a *progress bar* when loading the file. -\-\-animation-progress||Show a *progress bar* when playing the animation. -\-\-multi-file-mode=\||When opening multiple files, select if they should be grouped (`all`) or alone (`single`). Configuration files for all loaded files will be used in the order they are provided. -\-\-up=\<[+\|-][X\|Y\|Z]\>|+Y|Define the Up direction. --x, \-\-axis||Show *axes* as a trihedron in the scene. --g, \-\-grid||Show *a grid* aligned with the horizontal (orthogonal to the Up direction) plane. -\-\-grid\-unit=\||Set the size of the *unit square* for the grid. If set to non-positive (the default) a suitable value will be automatically computed. -\-\-grid\-subdivisions=\||Set the number of subdivisions for the grid. -\-\-grid\-color=\|(0,0,0)|Set the color grid lines. --e, \-\-edges||Show the *cell edges*. -\-\-camera-index=\||Select the scene camera to use when available in the file. Automatically computed by default. --k, \-\-trackball||Enable trackball interaction. -\-\-animation-autoplay||Automatically start animation. -\-\-animation-index=\|0|Select the animation to show.
Any negative value means all animations (glTF only).
The default scene always has at most one animation. -\-\-animation-speed-factor=\|1|Set the animation speed factor to slow, speed up or even invert animation time. -\-\-animation-time=\||Set the animation time to load. -\-\-font-file=\||Use the provided FreeType compatible font file to display text.
Can be useful to display non-ASCII filenames. -\-\-command-script=\||Provide a script file containing a list of commands to be executed sequentially.
Allows automation of multiple commands or pre-defined tasks. +\-\-verbose=\<[debug\|info\|warning\|error\|quiet]\>|string
info| Set *verbose* level, in order to provide more information about the loaded data in the console output. If no level is provided, assume `debug`. Option parsing may ignore this flag. +\-\-progress|bool
false|Show a *progress bar* when loading the file. +\-\-animation-progress|bool
false|Show a *progress bar* when playing the animation. +\-\-multi-file-mode=\|string
single|When opening multiple files, select if they should be grouped (`all`) or alone (`single`). Configuration files for all loaded files will be used in the order they are provided. +\-\-up=\<[+\|-][X\|Y\|Z]\>|string
+Y|Define the Up direction. +-x, \-\-axis|bool
false|Show *axes* as a trihedron in the scene. +-g, \-\-grid|bool
false|Show *a grid* aligned with the horizontal (orthogonal to the Up direction) plane. +\-\-grid\-unit=\|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=\|int
10|Set the number of subdivisions for the grid. +\-\-grid\-color=\|double_vector
(0,0,0)|Set the color grid lines. +-e, \-\-edges|bool
false|Show the *cell edges*. +\-\-camera-index=\|int
-|Select the scene camera to use when available in the file. Automatically computed by default. +-k, \-\-trackball|bool
false|Enable trackball interaction. +\-\-animation-autoplay|bool
false|Automatically start animation. +\-\-animation-index=\|int
0|Select the animation to show.
Any negative value means all animations (glTF only).
The default scene always has at most one animation. +\-\-animation-speed-factor=\|ratio
1|Set the animation speed factor to slow, speed up or even invert animation time. +\-\-animation-time=\|double
-|Set the animation time to load. +\-\-font-file=\|string
-|Use the provided FreeType compatible font file to display text.
Can be useful to display non-ASCII filenames. +\-\-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. ## Material options -Options|Default|Description +Options|Type
Default|Description ------|------|------ --o, \-\-point-sprites||Show sphere *points sprites* instead of the geometry. -\-\-point-sprites-type=\|sphere|Set the splat type when showing point sprites. -\-\-point-sprites-size=\|10.0|Set the *size* of point sprites. -\-\-point-size=\||Set the *size* of points when showing vertices. Model specified by default. -\-\-line-width=\||Set the *width* of lines when showing edges. Model specified by default. -\-\-backface-type=\||Set the Backface type. Model specified by default. -\-\-color=\|1.0, 1.0, 1.0| Set a *color* on the geometry. Multiplied with the base color texture when present.
Model specified by default. -\-\-opacity=\|1.0|Set *opacity* on the geometry. Multiplied with the base color texture when present.
Model specified by default. Usually used with Depth Peeling option. -\-\-roughness=\|0.3|Set the *roughness coefficient* on the geometry (0.0-1.0). Multiplied with the material texture when present.
Model specified by default. -\-\-metallic=\|0.0|Set the *metallic coefficient* on the geometry (0.0-1.0). Multiplied with the material texture when present.
Model specified by default. -\-\-hdri-file=\||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||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=\||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=\||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=\||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 \-\-metallic=1. Must be in linear color space.
Model specified by default. -\-\-texture-emissive=\||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=\|1.0, 1.0, 1.0|Set the emissive factor. This value is multiplied with the emissive color when an emissive texture is present.
Model specified by default. +-o, \-\-point-sprites|bool
false|Show sphere *points sprites* instead of the geometry. +\-\-point-sprites-type=\|string
sphere|Set the splat type when showing point sprites. +\-\-point-sprites-size=\|double
10.0|Set the *size* of point sprites. +\-\-point-size=\|double
-|Set the *size* of points when showing vertices. Model specified by default. +\-\-line-width=\|double
-|Set the *width* of lines when showing edges. Model specified by default. +\-\-backface-type=\|string
-|Set the Backface type. Model specified by default. +\-\-color=\|double_vector
-| Set a *color* on the geometry. Multiplied with the base color texture when present.
Model specified by default. +\-\-opacity=\|double
-|Set *opacity* on the geometry. Multiplied with the base color texture when present.
Model specified by default. Usually used with Depth Peeling option. +\-\-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=\|double
-|Set the *metallic coefficient* on the geometry (0.0-1.0). Multiplied with the material texture when present.
Model specified by default. +\-\-hdri-file=\|string
-|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=\|string
-|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=\|string
-|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=\|string
-|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 \-\-metallic=1. Must be in linear color space.
Model specified by default. +\-\-texture-emissive=\|string
-|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=\|double_vector
-|Set the emissive factor. This value is multiplied with the emissive color when an emissive texture is present.
Model specified by default. ## Window options -Options|Default|Description +Options|Type
Default|Description ------|------|------ -\-\-background-color=\|0.2, 0.2, 0.2|Set the window *background color*.
Ignored if *hdri* is set. -\-\-resolution=\|1000, 600|Set the *window resolution*. -\-\-position=\||Set the *window position* (top left corner) , in pixels, starting from the top left of your screens. --z, \-\-fps||Display a rendering *frame per second counter*. --n, \-\-filename||Display the *name of the file* on top of the window. --m, \-\-metadata||Display the *metadata*. -\-\-hdri-skybox||Show the HDRI as a skybox. Overrides \-\-background-color and \-\-no-background. --u, \-\-blur-background||Blur background.
Useful with a HDRI skybox. -\-\-blur-coc|20|Blur circle of confusion radius. -\-\-light-intensity|1.0|*Adjust the intensity* of every light in the scene. +\-\-background-color=\|double_vector
0.2, 0.2, 0.2|Set the window *background color*.
Ignored if *hdri* is set. +\-\-resolution=\|double_vector
1000, 600|Set the *window resolution*. +\-\-position=\|double_vector
-|Set the *window position* (top left corner) , in pixels, starting from the top left of your screens. +-z, \-\-fps|bool
false|Display a rendering *frame per second counter*. +-n, \-\-filename|bool
false|Display the *name of the file* on top of the window. +-m, \-\-metadata|bool
false|Display the *metadata*. +\-\-hdri-skybox|bool
false|Show the HDRI as a skybox. Overrides \-\-background-color and \-\-no-background. +-u, \-\-blur-background|bool
false|Blur background.
Useful with a HDRI skybox. +\-\-blur-coc|double
20|Blur circle of confusion radius. +\-\-light-intensity|double
1.0|*Adjust the intensity* of every light in the scene. ## Scientific visualization options -Options|Default|Description +Options|Type
Default|Description ------|------|------ --s, \-\-scalar-coloring||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=\||The coloring array name to use when coloring.
Use \-\-verbose to recover the usable array names. --y, \-\-comp=\|-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||Specify that the scalar array is to be found *on the cells* instead of on the points.
Use with the scalar option. -\-\-range=\||Set the *coloring range*. Automatically computed by default.
Use with the scalar option. --b, \-\-bar||Show *scalar bar* of the coloring by array.
Use with the scalar option. -\-\-colormap\-file=\||Set a *colormap file for the coloring*.
See [color maps](COLOR_MAPS.md).
Use with the scalar option. -\-\-colormap=\||Set a *custom colormap for the coloring*.
This is a list of colors in the format `val1,red1,green1,blue1,...,valN,redN,greenN,blueN`
where all values are in the range (0,1).
Ignored if `--colormap-file` option is specified.
Use with the scalar option. --v, \-\-volume||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. --i, \-\-inverse||Inverse the linear opacity function used for volume rendering. +-s, \-\-scalar-coloring|bool
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=\|string
-|The coloring array name to use when coloring.
Use \-\-verbose to recover the usable array names. +-y, \-\-comp=\|int
-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
false|Specify that the scalar array is to be found *on the cells* instead of on the points.
Use with the scalar option. +\-\-range=\|double_vector
-|Set the *coloring range*. Automatically computed by default.
Use with the scalar option. +-b, \-\-bar|bool
false|Show *scalar bar* of the coloring by array.
Use with the scalar option. +\-\-colormap\-file=\|string
-|Set a *colormap file for the coloring*.
See [color maps](COLOR_MAPS.md).
Use with the scalar option. +\-\-colormap=\|string
-|Set a *custom colormap for the coloring*.
This is a list of colors in the format `val1,red1,green1,blue1,...,valN,redN,greenN,blueN`
where all values are in the range (0,1).
Ignored if `--colormap-file` option is specified.
Use with the scalar option. +-v, \-\-volume|bool
false|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. +-i, \-\-inverse|bool
false|Inverse the linear opacity function used for volume rendering. ## Camera configuration options -Options|Default|Description +Options|Type
Default|Description ------|------|------ -\-\-camera-position=\||Set the camera position, overrides --camera-direction and camera-zoom-factor. -\-\-camera-focal-point=\||Set the camera focal point. -\-\-camera-view-up=\||Set the camera view up vector. Will be orthogonalized. -\-\-camera-view-angle=\||Set the camera view angle, a strictly positive value in degrees. -\-\-camera-direction=\||Set the camera direction, looking at the focal point. -\-\-camera-zoom-factor=\||Set the camera zoom factor relative to the autozoom on data, a strictly positive value. -\-\-camera-azimuth-angle=\|0.0|Apply an azimuth transformation to the camera, in degrees, added after other camera options. -\-\-camera-elevation-angle=\|0.0|Apply an elevation transformation to the camera, in degrees, added after other camera options. -\-\-camera-orthographic||Set the camera to use the orthographic projection. +\-\-camera-position=\|double_vector
-|Set the camera position, overrides --camera-direction and camera-zoom-factor. +\-\-camera-focal-point=\|double_vector
-|Set the camera focal point. +\-\-camera-view-up=\|double_vector
-|Set the camera view up vector. Will be orthogonalized. +\-\-camera-view-angle=\|double
-|Set the camera view angle, a strictly positive value in degrees. +\-\-camera-direction=\|double_vector
-|Set the camera direction, looking at the focal point. +\-\-camera-zoom-factor=\|double
-|Set the camera zoom factor relative to the autozoom on data, a strictly positive value. +\-\-camera-azimuth-angle=\|double
0.0|Apply an azimuth transformation to the camera, in degrees, added after other camera options. +\-\-camera-elevation-angle=\|double
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 -Options|Default|Description +Options|Type
Default|Description ------|------|------ --r, \-\-raytracing||Enable *OSPRay raytracing*. Requires OSPRay raytracing to be enabled in the linked VTK dependency. -\-\-samples=\|5|Set the number of *samples per pixel* when using raytracing. --d, \-\-denoise||*Denoise* the image when using raytracing. +-r, \-\-raytracing|bool
false|Enable *OSPRay raytracing*. Requires OSPRay raytracing to be enabled in the linked VTK dependency. +\-\-samples=\|int
5|Set the number of *samples per pixel* when using raytracing. +-d, \-\-denoise|bool
false|*Denoise* the image when using raytracing. ## PostFX (OpenGL) options -Options|Description -------|------ --p, \-\-translucency-support|Enable *translucency support*. This is a technique used to correctly render translucent objects. --q, \-\-ambient-occlusion|Enable *ambient occlusion*. This is a technique used to improve the depth perception of the object. --a, \-\-anti-aliasing|Enable *anti-aliasing*. This technique is used to reduce aliasing. --t, \-\-tone-mapping|Enable generic filmic *Tone Mapping Pass*. This technique is used to map colors properly to the monitor colors. -\-\-final-shader|Add a final shader to the output image. See [dedicated documentation](FINAL_SHADER.md) for more details. +Options|Type
Default|Description +------|------|------ +-p, \-\-translucency-support|bool
false|Enable *translucency support*. This is a technique used to correctly render translucent objects. +-q, \-\-ambient-occlusion|bool
false|Enable *ambient occlusion*. This is a technique used to improve the depth perception of the object. +-a, \-\-anti-aliasing|bool
false|Enable *anti-aliasing*. This technique is used to reduce aliasing. +-t, \-\-tone-mapping|bool
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](FINAL_SHADER.md) for more details. ## Testing options -Options|Default|Description +Options|Type
Default|Description ------|------|------ -\-\-ref=\||Render and compare with the provided *reference image*, for testing purposes. Use with output option to generate new baselines and diff images. -\-\-ref-threshold=\|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=\||Path to an interaction log file to *record interaction events* to. -\-\-interaction-test-play=\||Path to an interaction log file to *play interactions events* from when loading a file. +\-\-ref=\|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=\|double
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=\|string
-|Path to an interaction log file to *record interaction events* to. +\-\-interaction-test-play=\|string
-|Path to an interaction log file to *play interactions events* from when loading a file. ## Rendering options precedence @@ -152,10 +152,12 @@ Some rendering options are not compatible between them, here is the precedence o ## Options syntax -To turn on/off options, it is possible to write `--option=true` and `--option=false`, eg `--points-sprites=false`. +To turn on/off boolean options, it is possible to write `--option=true` and `--option=false`, eg `--points-sprites=false`. As documented, only the `--option=value` syntax is supported. The syntax `--option value` is not supported. +All options are parsed according to their type, see the [parsing documentation](PARSING.md) for more details. + ## Filename templating The destination filename used by `--output` or to save screenshots using `--screenshot-filename` can use the following template variables: diff --git a/doc/user/PARSING.md b/doc/user/PARSING.md new file mode 100644 index 0000000000..c4f5c4c1d3 --- /dev/null +++ b/doc/user/PARSING.md @@ -0,0 +1,58 @@ +# Parsing options + +When setting options from the [CLI Options](OPTIONS.md), the [commands](COMMANDS.md) or using the [libf3d options string API](../libf3d/OPTIONS.md#string-api), the values are parsed according to their type. + +The following types are supported: + - bool + - int + - double + - ratio + - string + +As well as vectors for each of these types. + +## Bool + +The following formats are supported when parsing a bool, case insensitive: + - true/false + - yes/no + - on/off + - 1/0 + +When formatting a bool into a string, true/false is used. + +## Int + +Int parsing is supported using [std::stoi](https://en.cppreference.com/w/cpp/string/basic_string/stol) and check +that the whole string is parsed. + +When formatting an int into a string, [std::to_string](https://en.cppreference.com/w/cpp/string/basic_string/to_string) is used. + +## Double + +Double parsing is supported using [std::stod](https://en.cppreference.com/w/cpp/string/basic_string/stol) and check +that the whole string is parsed. + +When formatting a double into a string, [std::ostringstream](https://en.cppreference.com/w/cpp/io/basic_ostringstream) is used +with removing the point and precision when the value is exactly an integer. + +## Ratio + +The following formats are supported when parsing a string into a ratio: + - percent% + - dividend/divisor + - double + +Percent, dividend, divisor are then parsed as double. + +When formatting a ratio into a string, it is formated as a double. + +## String + +String are parsed and formated as is. + +## Vectors + +Vector tokens are separated by `,`, tokens are then parsed using their respective types. + +When formatting a vector into a string, individual token are formated according to their type and separated using `,`. diff --git a/doc/user/QUICKSTART.md b/doc/user/QUICKSTART.md index 05f1fd3246..68bac5a587 100644 --- a/doc/user/QUICKSTART.md +++ b/doc/user/QUICKSTART.md @@ -56,6 +56,7 @@ For **default scene** formats, certain default values are set automatically: - normal-scale: 1.0 - metallic: 0.0 - roughness: 0.3 + - camera-orthographic: false They will be overridden when using corresponding [options](OPTIONS.md). diff --git a/doc/user/README_USER.md b/doc/user/README_USER.md index 7d5e5874c7..360c6695ae 100644 --- a/doc/user/README_USER.md +++ b/doc/user/README_USER.md @@ -8,6 +8,7 @@ - [How to use animations in F3D.](ANIMATIONS.md) - [How to configure F3D using a configuration file.](CONFIGURATION_FILE.md) - [The different commands available in F3D.](COMMANDS.md) +- [How are options values are parsed in F3D.](PARSING.md) - [How to use colormaps in F3D.](COLOR_MAPS.md) - [How to a use custom final shader in F3D.](FINAL_SHADER.md) - [How to integrate F3D in your desktop.](DESKTOP_INTEGRATION.md)