pub struct BladeStyle {
pub root_occlusion: [f32; 3],
pub occlusion_reach: f32,
pub tip_glow: [f32; 3],
pub glow_start: f32,
pub patch_color: [f32; 3],
pub patch_share: f32,
pub normal: BladeNormal,
}Expand description
Decision 4’s shading levers: “a base-to-tip gradient along the blade, an ambient-occlusion colour at the root, an additive tip colour (Acerola), clump-coloured patches (Ghost of Tsushima), and normals taken from the ground or straight up”.
The gradient is BladeType::root_color and BladeType::tip_color, which
every row has always carried; the rest are here. BladeStyle::PLAIN
pulls none of them, and a row carrying it draws exactly the picture it drew
before they existed — grass.slang’s grass_style returns its colour
unchanged for it, not merely close to it.
Fields§
§root_occlusion: [f32; 3]The colour a blade darkens toward at its root.
occlusion_reach: f32The fraction of a blade’s height the occlusion colour reaches up it, in
0..=1. Zero is no occlusion at all.
tip_glow: [f32; 3]The colour added toward a blade’s tip. Black adds nothing.
glow_start: f32The fraction of a blade’s height the tip colour starts at, in 0..1; it
rises linearly from there to all of itself at the tip.
patch_color: [f32; 3]The colour a patch of blades leans toward.
The most of BladeStyle::patch_color a patch takes, in 0..=1; each
patch takes its own hashed share of it. Zero is no patches.
A patch is a clump — decision 2’s Voronoi cells, which every blade
belongs to whatever its row’s BladeType::clumping — so the colour
follows the same structure the facing and the height do.
normal: BladeNormalThe normal the row shades by.