pub struct SceneDesc<'a> {
pub meshes: Vec<MeshDesc<'a>>,
pub materials: Vec<GpuMaterial>,
pub page: PageDesc<'a>,
pub probes: ProbeGrid,
pub capacities: Capacities,
}Expand description
Everything a ForwardRenderer makes
resident, and how much room it reserves for it.
Read once, at with_scene,
and never again: the pools it sizes are created there and none of them grows.
The order of meshes and materials is
load-bearing — see the module docs.
Fields§
§meshes: Vec<MeshDesc<'a>>The resident meshes, in the order their table ids are handed out.
materials: Vec<GpuMaterial>§3.2’s material table, row by row. Row 0 is what an instance written without a material id names, so it is the row every unassigned object shades through.
page: PageDesc<'a>The base-colour page the rows above index.
probes: ProbeGridTopic 50’s irradiance volume, added to the flat ambient term wherever it covers.
ProbeGrid::default is a grid of nothing and changes no pixel, which
is what a description that does not mention it gets.
capacities: CapacitiesHow much room each pool reserves.
Implementations§
Source§impl SceneDesc<'_>
impl SceneDesc<'_>
Sourcepub fn instance_bounds(
&self,
instances: &[InstanceDesc],
root: Mat4,
) -> Result<Aabb, SceneBoundsError>
pub fn instance_bounds( &self, instances: &[InstanceDesc], root: Mat4, ) -> Result<Aabb, SceneBoundsError>
The box around every vertex of instances, each placed by
root * instance.transform.
Folded from the placed vertices, so it is the tightest axis-aligned box
around them; Aabb::transformed of the mesh’s own box would contain
them too, but is larger under any rotation that is not a quarter turn.
A Geometry::Dag is bounded by level 0, its finest. An instance whose
mesh has no vertices contributes nothing.
A placed vertex that is NaN or infinite fails the call — from a bad
vertex, a bad instance transform or root, or a finite product that
overflowed. Aabb::from_points would skip a NaN, which a cull box
wants and a placement or collision box does not.
§Errors
The first SceneBoundsError an instance meets, in slice order, and
SceneBoundsError::Empty when no instance has a vertex.
Sourcepub fn instance_parts(
&self,
instances: &[InstanceDesc],
) -> Result<Vec<Aabb>, SceneBoundsError>
pub fn instance_parts( &self, instances: &[InstanceDesc], ) -> Result<Vec<Aabb>, SceneBoundsError>
One box per instance, in slice order, each around its mesh’s vertices
placed by InstanceDesc::transform alone — the parts of a rigid
compound in the frame the instance transforms are written in.
Widened to f64, they are what crcbl_phys::AabbCompound::new takes:
every box is finite and none is inverted. A flat part (an axis where
min == max, from planar geometry or a zero scale) is returned as it
is; a caller wanting a minimum thickness pads it.
§Errors
The first SceneBoundsError an instance meets, in slice order,
including SceneBoundsError::EmptyPart for a mesh with no vertices.
An empty slice is not an error: it yields no parts.