Example for loading and writing OBJ, PLY and STL meshes.
- Default input list:
inputs.json - Default mode:
batch - Default tuning:
heuristic - Output meshes:
saved/ - Output screenshots:
screenshots/ - Default startup resolves
inputs.jsonfrom the example directory layout and is not tied to the current working directory
batch- Uses test list and runs normal workflow.
- If test list has
row_view: true, assets are laid out in one inspection scene.
interactive- Opens file dialog and loads one model.
ci- Runs strict pass/fail validation per case.
row_viewmeans one inspection scene containing all cases from the test list.geometryandgeometry collectionassets are normalized and laid out left-to-right so camera framing is stable for comparisons.sceneassets are laid out as one row tile while keeping their authored internal instance transforms.
- Quick visual check:
- run default
batch
- run default
- Inspect one local model:
- run with
--interactive
- run with
- Validate load/write correctness:
- run with
--ci
- run with
- Use this when you want larger/public inputs downloaded automatically.
- Public dataset repository:
https://github.com/Devsh-Graphics-Programming/Nabla-Benchmark-Datasets
- Configure options:
NBL_MESHLOADERS_ENABLE_BENCHMARK_DATASETS=ONNBL_MESHLOADERS_DEFAULT_START_WITH_BENCHMARK_TESTLIST=ON|OFF(default:OFF)NBL_MESHLOADERS_BENCHMARK_DATASET_DIR=<path>(optional, default: build dir)NBL_MESHLOADERS_BENCHMARK_DATASET_REPO=<git-url>(optional, default: public repo above)NBL_MESHLOADERS_BENCHMARK_PAYLOAD_RELATIVE_PATH=<path>(optional, default:inputs_benchmark.json)
- What CMake does:
- first tries payload from
examples_tests/media/<NBL_MESHLOADERS_MEDIA_PAYLOAD_RELATIVE_PATH> - fetches/clones dataset repo during configure via CMake
FetchContent(if payload file is missing) - resolves committed payload JSON from repo:
<dataset_dir>/<payload_relative_path>- verifies payload is a regular Git file (not an LFS pointer)
- first tries payload from
- Run benchmark list with:
--testlist <dataset_dir>/<payload_relative_path>
- Default startup behavior when benchmark datasets are enabled:
NBL_MESHLOADERS_DEFAULT_START_WITH_BENCHMARK_TESTLIST=OFF: still starts from localinputs.json(3 models)NBL_MESHLOADERS_DEFAULT_START_WITH_BENCHMARK_TESTLIST=ON: starts from benchmark payload test list
- Run benchmark CI directly via
ctest:ctest --output-on-failure -C Debug -R NBL_MESHLOADERS_CI_BENCHMARK- runs both benchmark CI modes:
heuristicandhybrid - when benchmark datasets are enabled, benchmark
ctestalso writes structured performance run artifacts - if a matching reference exists for the current workload and machine profile, strict comparison is enabled automatically
- Run default CI directly via
ctest(no benchmark datasets enabled):ctest --output-on-failure -C Debug -R ^NBL_MESHLOADERS_CI$- uses default
inputs.json(3 inputs)
--ci- strict validation run
--interactive- file-dialog run
--testlist <path>- custom JSON list
- relative JSON path resolves against local input CWD
- relative case paths inside the JSON resolve against the JSON file directory
--savegeometry- keep writing output meshes
--savepath <path>- force output path
--row-add <path>- add model to row view at startup
- scene assets added this way keep their internal transforms inside one row tile
--row-duplicate <count>- duplicate last row-view case
--loader-perf-log <path>- redirect loader diagnostics
--loader-content-hashes- keep loader content hashes enabled
- this is already the default for this example
--runtime-tuning <sequential|heuristic|hybrid>- IO runtime tuning mode
--perf-dump-dir <path>- write structured performance run JSON artifacts
- relative paths resolve against local output CWD
--perf-ref-dir <path>- lookup directory for structured performance references
- relative paths resolve against local output CWD
- absolute paths may be shortened internally when a shorter relative runtime path is available
--perf-strict- fail on performance regression only when a matching reference exists
- if no matching reference exists, the run stays record-only
--perf-profile-override <name>- override the automatically derived machine profile id
--perf-update-reference- write the current structured performance run to the matching reference path
- requires
--perf-ref-dir - cannot be combined with
--perf-strict
- Arrow keys: move camera
- Left mouse drag: rotate camera
Home: reset viewA: add model to row viewX: clear row view inspection sceneR: reload current test list or interactive model
{
"row_view": true,
"cases": [
"../media/cornell_box_multimaterial.obj",
{ "name": "spanner", "path": "../media/ply/Spanner-ply.ply" },
{ "path": "../media/Stanford_Bunny.stl" }
]
}Rules:
casesis required and must be an array- case item can be string path or object with
pathand optionalname - relative paths resolve against JSON file directory
- default startup uses
inputs.jsonresolved from the example directory layout rather than the process working directory row_view: truekeeps geometry assets in direct row layout and places each scene asset as one row tile with authored internal transforms preserved inside that tile.
- Per-case image consistency:
*_loaded.pngvs*_written.pngcode-unit diff- thresholds come from
MaxImageDiffCodeUnitsandMaxImageDiffCodeUnitValueinApp.hpp
- Any mismatch ends with non-zero exit code
- Structured performance output is keyed by:
workload_id- derived from the benchmark/test input definition and runtime mode
profile_id- derived from the current CPU-centric machine/runtime profile or overridden explicitly
- Structured performance artifacts also carry provenance:
created_at_utcnabla_commitnabla_dirtyexamples_commitexamples_dirty
- Reference lookup uses:
<perf-ref-dir>/<workload_id>/<profile_id>.json
- If no matching reference exists:
- no comparison is performed
- the run only writes its current JSON artifact
- If a matching reference exists:
- per-case
original_load,write, andwritten_loadstage metrics are compared - strict mode fails only on actual regression, not on missing references
- per-case
- If
--perf-update-referenceis used:- the current run is written directly to
<perf-ref-dir>/<workload_id>/<profile_id>.json - existing comparison is skipped for that run
- the current run is written directly to
- JSON artifacts avoid host-specific absolute paths and store portable case/test-list identifiers instead
Asset load call perfforgetAssetAsset write call perfforwriteAsset
Internal loader stage logs are diagnostics only.