Module frenderer::meshes

source ·
Expand description

Similar to sprite groups and individual sprites, in frenderer there are mesh groups and individual meshes. Each individual mesh has some submeshes that are all grouped together (different submeshes can use different materials); meshes can have some number of instances (you set an estimate for the number of instances of each mesh when you’re adding the mesh group; it can grow at runtime but it might be costly so try to minimize the amount of growth), and the setting of instance data and uploading of instance data to the GPU are separated like they are for sprites. The only instance data is a 3D transform (translation, rotation, and a uniform scaling factor (so it fits neatly into 8 floats). Rotations are defined as quaternions.

This module defines two renderers: the textured renderer MeshRenderer and the flat-colored renderer FlatRenderer. They use slightly different vertex coordinates (e.g., the mesh renderer has UV coordinates).

3D graphics in frenderer use a right-handed, y-up coordinate system.

Structs§

  • A 3D perspective camera positioned at some point and rotated in some orientation (a quaternion).
  • Renders groups of 3D meshes with flat colors and no lighting.
  • A vertex for meshes in the FlatRenderer.
  • An entry in a mesh group, i.e. a 3D model.
  • An opaque identifier for a mesh group.
  • Renders groups of 3D meshes with textures and no lighting.
  • The range of indices and base vertex for a single submesh.
  • A transform in 3D space comprised of a translation, a rotation (a quaternion), and a scale.
  • A vertex for meshes in the MeshRenderer.

Type Aliases§