farthing/lib.rs
1//! # farthing
2//!
3//! Mesh LOD for real-time 3D, engine-agnostic: farthing works on geometry and opaque material
4//! slots, and reaches real materials only through the [`host::RenderHost`] boundary.
5//!
6//! The data model lives at the crate root:
7//!
8//! * [`Mesh`] — an indexed triangle mesh whose vertices are *wedges*: one vertex per
9//! unique attribute set, so a UV seam is two vertices at one position (the GPU layout).
10//! * [`Scene`] — meshes, instances with world transforms, skeletons and opaque material
11//! slots. farthing never knows what a material looks like.
12//! * [`host::RenderHost`] — the boundary to the engine. Anything that needs real materials
13//! (baking, impostor captures, alpha-aware visibility, image metrics) goes through it.
14//! * [`bvh::Bvh`] — binned-SAH bounding volume hierarchy for ray casts and closest-point queries.
15//! * [`image::Image`], [`metrics`] — float images and quality metrics.
16//!
17//! The processors are modules:
18//!
19//! * [`reduce`] — attribute-aware quadric edge-collapse reduction, repair, vertex-cache optimization.
20//! * [`uv`] — chart-based UV parameterization and atlas packing.
21//! * [`bake`] — material casting from a source to a target surface through the host.
22//! * [`aggregate`] — many meshes and materials into one mesh with one atlas.
23//! * [`voxel`] — voxel remeshing (watertight proxies) and conservative occluders.
24//! * [`visibility`] — camera-sampled visibility culling and texel budgets.
25//! * [`impostor`] — octahedral, flipbook, single-view and billboard-cloud impostors.
26//! * [`bones`] — skinning LOD: influence limiting and bone removal.
27//! * `io` — glTF 2.0 and OBJ import/export (feature `io`, on by default).
28
29#![forbid(unsafe_code)]
30#![allow(
31 clippy::too_many_arguments,
32 clippy::needless_range_loop,
33 clippy::type_complexity
34)]
35
36// Data model.
37pub mod bvh;
38pub mod error;
39pub mod host;
40pub mod image;
41pub mod math;
42pub mod mesh;
43pub mod metrics;
44pub mod quad;
45pub mod raster;
46pub mod rng;
47pub mod scene;
48
49// Processors.
50pub mod aggregate;
51pub mod bake;
52pub mod bones;
53pub mod impostor;
54#[cfg(feature = "io")]
55pub mod io;
56pub mod reduce;
57pub mod uv;
58pub mod visibility;
59pub mod voxel;
60
61pub use error::{Error, Result};
62pub use glam;
63pub use math::Aabb;
64pub use mesh::{Mesh, MorphTarget, Skin};
65pub use scene::{Instance, Joint, MaterialId, MaterialSlot, Scene, Skeleton};