#[repr(u8)]pub enum BlendMode {
Opaque = 0,
AlphaBlend = 1,
Additive = 2,
Volumetric = 3,
}Expand description
How a voxel’s colour combines with what is already behind it along a ray.
Variants§
Opaque = 0
Fully opaque: the first solid hit wins and occludes everything behind
it — the existing render path. A voxel’s alpha is ignored.
AlphaBlend = 1
Front-to-back over compositing; alpha is the voxel’s opacity.
Glass, smoke, water.
Additive = 2
Commutative additive glow: contributes alpha·colour to the pixel
without occluding what is behind it (order-independent). Spells,
fire, magic auras, muzzle flashes.
Volumetric = 3
Thickness-aware Beer–Lambert absorption for filled volumes (true
smoke, fog, murky water). Unlike [AlphaBlend] (which composites one
alpha per surface run, so opacity is independent of thickness — ideal
for shells/glass), Volumetric weights each voxel’s opacity by the
ray’s path length through it: the per-cell effective opacity is
1 − (1 − alpha)^seg_len where seg_len is the traversed length in
voxel units. A boundary sliver contributes ≈0 (no voxel-grid dicing)
while opacity grows smoothly with depth. Occludes like AlphaBlend.