[][src]Module all_is_cubes::triangulator

Algorithms for converting blocks/voxels to triangle-based rendering (as opposed to raytracing, voxel display hardware, or whatever else).

All of the algorithms here are independent of graphics API but may presume that one exists and has specific data types to specialize in.

Note: Some sources say that “tesselation” would be a better name for this operation than “triangulation”. However, “tesselation” means a specific other operation in OpenGL graphics programming, and “triangulation” seems to be the more commonly used terms.

Structs

BlockRenderData

Describes how to draw a block. Pass it to triangulate_space to use it.

BlockVertex

Generic structure of output from triangulator. Implement GfxVertex to provide a specialized version.

NullTextureAllocator

TextureAllocator which discards all input; for testing.

Enums

Coloring

Traits

TextureAllocator

Allocator of 2D textures to paint block faces into.

TextureTile

2D texture to paint block faces into. It is assumed that when this value is dropped, the texture allocation will be released.

ToGfxVertex

Implement this trait along with From<BlockVertex> to provide a representation of BlockVertex suitable for the target graphics system.

Functions

new_space_buffer

Allocate an output buffer for triangulate_space.

triangulate_blocks

Precomputes vertices for blocks present in a space.

triangulate_space

Computes a triangle-based representation of a Space for rasterization.

Type Definitions

BlocksRenderData

Collection of BlockRenderData indexed by a Space's block indices. Pass it to triangulate_space to use it.

Texel
TextureCoordinate