Skip to main content

Crate farthing

Crate farthing 

Source
Expand description

§farthing

Mesh LOD for real-time 3D, engine-agnostic: farthing works on geometry and opaque material slots, and reaches real materials only through the host::RenderHost boundary.

The data model lives at the crate root:

  • Mesh — an indexed triangle mesh whose vertices are wedges: one vertex per unique attribute set, so a UV seam is two vertices at one position (the GPU layout).
  • Scene — meshes, instances with world transforms, skeletons and opaque material slots. farthing never knows what a material looks like.
  • host::RenderHost — the boundary to the engine. Anything that needs real materials (baking, impostor captures, alpha-aware visibility, image metrics) goes through it.
  • bvh::Bvh — binned-SAH bounding volume hierarchy for ray casts and closest-point queries.
  • image::Image, metrics — float images and quality metrics.

The processors are modules:

  • reduce — attribute-aware quadric edge-collapse reduction, repair, vertex-cache optimization.
  • uv — chart-based UV parameterization and atlas packing.
  • bake — material casting from a source to a target surface through the host.
  • aggregate — many meshes and materials into one mesh with one atlas.
  • voxel — voxel remeshing (watertight proxies) and conservative occluders.
  • visibility — camera-sampled visibility culling and texel budgets.
  • impostor — octahedral, flipbook, single-view and billboard-cloud impostors.
  • bones — skinning LOD: influence limiting and bone removal.
  • io — glTF 2.0 and OBJ import/export (feature io, on by default).

Re-exports§

pub use error::Error;
pub use error::Result;
pub use math::Aabb;
pub use mesh::Mesh;
pub use mesh::MorphTarget;
pub use mesh::Skin;
pub use scene::Instance;
pub use scene::Joint;
pub use scene::MaterialId;
pub use scene::MaterialSlot;
pub use scene::Scene;
pub use scene::Skeleton;
pub use glam;

Modules§

aggregate
Scene aggregation: merge instances into one mesh with a shared, repacked atlas.
bake
Material baking: transfer a source surface’s appearance onto a proxy’s UVs.
bones
Bone reduction: influence limiting and skinned-error bone removal.
bvh
Binned-SAH bounding volume hierarchy over triangles.
error
host
The engine boundary.
image
Linear float RGBA images.
impostor
Impostors: octahedral and flipbook captures, billboard clouds and surfel proxies.
io
glTF and OBJ import and export (feature io, on by default).
math
Small geometric helpers.
mesh
Indexed triangle meshes with per-vertex (“wedge”) attributes.
metrics
Quality metrics: surface distance between meshes and image difference.
quad
Pure-quad meshes, for quad-aware reduction.
raster
CPU reference renderer for triangle-ID buffers (the default crate::host::RenderHost::render_ids).
reduce
Mesh reduction: triangle and quad simplification, LOD chains, repair and vertex-cache ordering.
rng
Tiny deterministic PCG32 generator, so results are reproducible without extra dependencies.
scene
Scenes: meshes, instances, skeletons and opaque material slots.
uv
UV parameterization (LSCM, ARAP, planar) and atlas packing.
visibility
Camera-sampled visibility: cull hidden triangles and weight the visible ones.
voxel
Voxel remeshing and occluder generation.