Skip to main content

BladeStyle

Struct BladeStyle 

Source
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: f32

The 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: f32

The 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.

§patch_share: f32

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: BladeNormal

The normal the row shades by.

Implementations§

Source§

impl BladeStyle

Source

pub const PLAIN: Self

No lever pulled: no occlusion, no glow, no patches, the ground’s normal.

Trait Implementations§

Source§

impl Clone for BladeStyle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BladeStyle

Source§

impl Debug for BladeStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BladeStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BladeStyle

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BladeStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.