Configuration

 
Important Note

Outdated Version:
You are looking at an outdated documentation version for an older RapidCompact CLI distribution. If you are using a newer version of the CLI please refer to the documentation of the current CLI release version.

< previous page next page >
 

Creating and Using a Config File

 back to top

Some parameters for RapidCompact CLI are directly available with the respective commands. However, many relevant options (like the choice of a specific algorithm for a certain task, or the resolution for a specific type of texture image) are only available via the settings mechanism of RapidCompact CLI. The ratio behind this is to ease usage of the command line, especially for users that are not familiar with all the details, while still allowing you to configure all relevant parameters when necessary.

One way to configure the settings is to use a config file. The config file is a text file in JSON format, which can be easily edited. To create one that already contains the default values for all the available settings, use the command write_config with a filename. Example:

         rpdx --write_config rpd_config.json         

Additionally it is possible to just use the short command write_config without an argument. The resulting file will always be named as default: rpd_config.json Example:

         rpdx --write_config

This example writes a config file with filename "rpd_config.json". This special filename is used by RapidCompact CLI to check, on startup, for an existing config file inside the current directory. If the file has another filename, or if it is placed at another location, you can use the read_config command to read it when launching RapidCompact CLI. Example:

         rpdx --read_config someDirectory/myConfig.json         

Changing the settings inside a config file is pretty straightforward - just use your favorite text editor to alter the default values and save the file. When looking into a config file, you will notice that settings' names are using a URN-like scheme, separating several parts of the name by a colon. Examples:

             [...]
             "decimation:method" : "quadric",
             "rendering:imageWidth"  : 1024,
             "rendering:imageHeight" : 1024,
             [...]

The colons are used to separate different parts of each setting's name, where the first part is always the subsystem of RapidCompact CLI that uses the setting. In the above example, for instance, the prefix "rendering" tells us that the following part "imageWidth" refers to a setting inside that subsystem (and nowhere else). For example, the width of images for texture generation will not be affected by this setting.

 

Changing Settings using the Command Line

 back to top

Sometimes, you might want to try out different settings without having to use a config file. This is easily possible by using the command set (shorthand: s). Example:

         rpdx -i myMesh.ply -s decimation:method edgeLength --decimate v:10% -e myMesh-decimated.ply         

In this example, a mesh is loaded and its 3D geometry is decimated to 10% of the original vertices. Instead of using the standard decimation method or the one from the default config file, it is explicitly set to edgeLength before the decimater is used.

In general, the default value of a setting can be overriden in both ways, using a config file or using the command line. Both methods, using a config file and using s on the command line, override the current values of the given settings, so the current value of a setting also depends on the order in which previous read_config or s commands are executed. If you have use for this, you can also split up one large config file into multiple smaller ones, to separate different aspects of configuration. This is possible since the settings specified inside the config file do not need to be complete. Instead, a config file will only override settings for the parameters that are specified, leaving unspecified settings untouched. Example:

         rpdx --read_config decimation_config.json --read_config rendering_config.json ...         

Finally, to print the current value of a setting, there is also a get command (shorthand: g).

 

Changing Logging Verbosity

 back to top

By default, RapidCompact CLI will print some information to the standard output while executing commands. By specifying a log level, you can influence how verbose this output will be. To do so, use the "logging:infoLevel" setting. The corresponding values are:


Available Settings

 back to top

The following table lists all available settings of RapidCompact CLI, grouped by the related functionality or command.

 
General

Name Type Default Valid Range Quick Description
general:maxConcurrentThreads Int 0 {0 .. inf} maximum number of concurrent threads. 0 means no limit (adapts to number of cores), other numbers act as fixed maximum.
general:normalsHardAngleDeg Real 60 {0 .. 180} hard angle (degrees) used for normal generation (0 = everything flat, 180 = everything smooth)
general:normalsComputationMethod String area angle, area

 
Log

Name Type Default Valid Range Quick Description
logging:infoLevel Int 3 {0 .. 4} logging verbosity (0 = quiet, 4 = debug)

 
Model Import

Name Type Default Valid Range Quick Description
import:rotateZUp Flag false {true, false} turns rotation to z-axis pointing upwards on/off
back to top

 
Model Export

Name Type Default Valid Range Quick Description
export:centerModel Flag false {true, false} centers the model around the coordinate origin before export
export:displacementToNormalMapAlpha Flag false {true, false} bakes displacement values into the normal map's alpha channel
export:preferBinaryFormat Flag true {true, false} turns export in binary format on/off (if available)
export:unlitMaterials Flag false {true, false} enables that all materials are specified as unlit, for .gltf/.glb export
export:baseColorMapFormat String auto jpg; png desired output file format for base color maps
export:displacementMapFormat String auto jpg; png desired output file format for displacement maps
export:emissiveMapFormat String auto jpg; png desired output file format for emissive maps
export:geometryCompression String none none; draco; dracoLossy desired geometry compression (currently only available for GLTF/GLB export)
export:metallicMapFormat String auto jpg; png desired output file format for metallic maps
export:normalMapFormat String auto jpg; png desired output file format for normal maps
export:occlusionMapFormat String auto jpg; png desired output file format for occlusion maps
export:roughnessMapFormat String auto jpg; png desired output file format for roughness maps
export:textureMapFilePrefix String prefix to be used for texture map names

 
Geometry Compression

Name Type Default Valid Range Quick Description
geoCompression:normalQuantization Int 10 {1 .. 32} bits per normal vertex attribute (if geometry compression is enabled)
geoCompression:positionQuantization Int 14 {1 .. 32} bits per position vertex attribute (if geometry compression is enabled)
geoCompression:uvQuantization Int 12 {1 .. 32} bits per UV vertex attribute (if geometry compression is enabled)
back to top

 
Material Settings

Name Type Default Valid Range Quick Description
material:defaultMetallic Real 0.2 {0 .. 1} default material metallic property
material:defaultRoughness Real 0.4 {0 .. 1} default material roughness property
material:defaultBaseColor String 1 1 1 , , default material base color

 
Rendering

Name Type Default Valid Range Quick Description
rendering:showBackFaces Flag false {true, false} turns rendering of backfaces on/off
rendering:imageHeight Int 1024 {1 .. 8192} height to be used for rendered images
rendering:imageWidth Int 1024 {1 .. 8192} width to be used for rendered images
rendering:sampleCount Int 4 {1 .. inf} number of samples per pixel for image rendering
rendering:background String transparent {'transparent', 'white', 'black', 'gradientGray'} background to be used for rendered images
rendering:cameraPosition String auto auto camera position vector for rendering
rendering:cameraUpVector String 0 1 0 , , camera up direction for rendering
rendering:cameraViewVector String 0 0 -1 , , camera direction vector for rendering
rendering:shadingMode String pbr {'pbr', 'wireframe', 'flat', 'diffuse'} rendering method
back to top

 
Texture Baking

Name Type Default Valid Range Quick Description
baking:generateDisplacement Flag false {true, false} enables/disables the generation of displacement maps
baking:generateNormal Flag true {true, false} enables/disables the generation of normal maps
baking:tangentSpaceNormals Flag true {true, false} switches between tangent-/object-space normal maps
baking:baseColorMapResolution Int 2048 {1 .. 8192} resolution for baked base color maps
baking:displacementMapResolution Int 2048 {1 .. 8192} resolution for baked displacement maps
baking:metallicMapResolution Int 2048 {1 .. 8192} resolution for baked metallic maps
baking:normalMapResolution Int 2048 {1 .. inf} resolution for baked normal maps
baking:occlusionMapResolution Int 2048 {1 .. 8192} resolution for baked AO maps
baking:roughnessMapResolution Int 2048 {1 .. 8192} resolution for baked roughness maps
baking:sampleCount Int 4 {1, 4, 8} number of samples per texel for texture baking
baking:forcedDisplacementMax Real 0 {-inf .. inf} (see baking:forcedDisplacementMin)
baking:forcedDisplacementMin Real 0 {-inf .. inf} when forcedDisplacementMax and forcedDisplacementMax are given and valid (min < max), their values are used to clamp and normalize the final entries in the displacement map
back to top

 
Ambient Occlusion

Name Type Default Valid Range Quick Description
ao:enabled Flag false {true, false} turns AO (Ambient Occlusion) generation on/off
ao:replaceMissingAlbedo Flag true {true, false} turns replacement of missing base color by AO map on/off
ao:textureSamples Int 8 {0 .. 64} number of samples per texel for AO map generation
ao:vertexSamples Int 100 {1 .. 1024} number of samples per vertex for AO generation
ao:filterRadius Real 5 {0 .. 16} filter radius for smoothing the AO map (if any)

 
UV Inpainting

Name Type Default Valid Range Quick Description
inpainting:radius Real 32 {0 .. 32} radius, in pixels, for texture inpainting

 
Mesh Decimation

Name Type Default Valid Range Quick Description
decimation:collapseUnconnectedVertices Flag true {true, false} switches collapsing of nearby, unconnected vertices on/off
decimation:preserveTopology Flag false {true, false} switches computation of new normals after decimation on or off
decimation:preserveUVs Flag false {true, false} preserves texture coordinates during decimation
decimation:recomputeNormals Flag true {true, false} switches computation of new normals after decimation on or off
decimation:boundaryPreservationFactor Real 0.5 {0 .. 1} factor to steer preservation of boundaries during decimation
decimation:collapseDistanceThreshold Real 0.05 {0 .. 0.10000000000000001} threshold w.r.t BBox diagonal for collapsing nearby vertices
decimation:qualityWeight Real 0 {0 .. 1} weights for vertex quality values during decimation, if any
decimation:defaultTarget String f:20000 ; f:; %; f:% target parameter for decimation during compact
decimation:method String quadric {'quadric', 'edgeLength'} method to be used for decimation
back to top

 
Remeshing

Name Type Default Valid Range Quick Description
remeshing:quadDominant Flag false {true, false} switches remeshing from creating quad meshes to quad dominant meshes

 
Mesh Segmentation

Name Type Default Valid Range Quick Description
segmentation:maxPrimitivesPerChart Int 10000 {1 .. inf} limits max number primitives in any UV chart
segmentation:chartAngleDeg Real 130 {0 .. 360} threshold (degrees) for overall curvature of 3D charts
segmentation:cutAngleDeg Real 88 {0 .. 180} threshold (degrees) for cutting sharp edges

 
Mesh Unwrapping

Name Type Default Valid Range Quick Description
unwrapping:cutOverlappingPieces Flag true {true, false} turns removal of UV self-overlaps through cutting on/off
unwrapping:method String isometric {'isometric', 'forwardBijective', 'fixedBoundary', 'fastConformal', 'conformal'} method to be used for UV unwrapping
back to top

 
Chart Packing

Name Type Default Valid Range Quick Description
packing:chartPadding Real 0.000488281 {0 .. 1} relative desired padding around charts inside the UV atlas

< previous page next page >