QtCraft API C++ classes QML types Handbook

QcChunkMesher Class

Builds the triangle mesh of one chunk section from the boxes of every block state: hidden faces are culled, every vertex gets face shading, ambient occlusion, sky light and block light. More...

Header: #include <clientcore/meshing/QcChunkMesher.h>

Static Public Members

const std::array<float, 4> ambientOcclusionLevels
const std::array<float, 6> faceShade
const int lightMargin
const float liquidSurfaceDrop
QcChunkMesh mesh(const QcMeshInput &input)

Detailed Description

Pure function of its input, safe to run on worker threads.

Member Function Documentation

[static] QcChunkMesh QcChunkMesher::mesh(const QcMeshInput &input)

Returns the mesh of the section input describes.

Member Variable Documentation

const std::array<float, 4> QcChunkMesher::ambientOcclusionLevels

Brightness by number of occluders around a vertex (0 = fully occluded corner).

const std::array<float, 6> QcChunkMesher::faceShade

Shading of faces by direction, indexed by QcBlockFace.

const int QcChunkMesher::lightMargin

Sky light of a section is computed over the cells from this many blocks below to this many blocks above it (and one chunk around it).

const float QcChunkMesher::liquidSurfaceDrop

Depth by which the surface of a liquid lies below the block top.