Skip to main content

IfsPacked

Struct IfsPacked 

Source
pub struct IfsPacked {
    pub linear: [[f32; 4]; 4],
    pub translate: [[f32; 4]; 2],
    pub cumulative_p: [f32; 4],
    pub fixed: [[f32; 4]; 2],
    pub root_recip: f32,
}
Expand description

What the compute step receives: the four linear parts, the four translations packed two per vec4, and the cumulative probabilities the shader compares a unit draw against.

Cumulative rather than raw because the shader’s job is then three compares against a rising table instead of a running sum it would have to recompute per particle per step. The last entry is 1.0 by construction and is never read — the fourth map is the else arm, which is also what makes a draw of exactly 1.0 land somewhere legal.

Fields§

§linear: [[f32; 4]; 4]

Per map: a, b, c, d.

§translate: [[f32; 4]; 2]

Four (e, f) translation pairs, two per row.

§cumulative_p: [f32; 4]

c0, c1, c2, 1.0.

§fixed: [[f32; 4]; 2]

The four respawn targets (ADR-0087), packed two (x, y) per row exactly as translate is. Straight from fixed_points, so the padded slots already duplicate a drawn map and the shader picks one of four with no branch and no knowledge of the probability table.

§root_recip: f32

The reciprocal of skeleton_scale (ADR-0088) — what the step shader multiplies a raw nearest-fixed-point distance by to get the [0, 1]-ish colour coordinate it stores on the particle.

Shipped as a reciprocal rather than as the diameter because the shader then multiplies where it would otherwise divide, per particle per step.

Implementations§

Source§

impl IfsPacked

Source

pub const ZERO: Self

The all-zero payload the four map families upload.

They never read it — the step shader’s IFS arm is the only consumer — but the uniform is one struct for every family, so it has to carry something. Zeros rather than a stray fern: a family that reached this data by mistake then draws nothing rather than a second figure.

Trait Implementations§

Source§

impl Clone for IfsPacked

Source§

fn clone(&self) -> IfsPacked

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 Debug for IfsPacked

Source§

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

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

impl PartialEq for IfsPacked

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for IfsPacked

Source§

impl StructuralPartialEq for IfsPacked

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, 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,