nightshade 0.57.0

A cross-platform data-oriented game engine.
Documentation
//! Meshlet mesh component definitions.

/// Renders the baked meshlet mesh registered under `asset_id` at the entity's
/// global transform.
///
/// Bake a mesh with `from_mesh`, hand it to `MeshletAssets::register` to get an
/// id, and put that id on an entity alongside a
/// [`LocalTransform`](crate::ecs::transform::components::LocalTransform) and a
/// [`GlobalTransform`](crate::ecs::transform::components::GlobalTransform). The
/// asset is uploaded to the GPU the first frame something references it and
/// stays resident afterwards, so any number of entities can share one id: the
/// geometry costs one upload whether one entity references it or a hundred
/// thousand do.
///
/// Needs the `meshlet` feature to draw. The component still compiles without
/// it, because the component schema cannot gate a single field, but nothing
/// renders it and there is no way to obtain a valid `asset_id` in the first
/// place.
#[derive(
    Default,
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    serde::Serialize,
    serde::Deserialize,
    enum2schema::Schema,
)]
pub struct MeshletMesh {
    pub asset_id: u64,
}