pub struct BlendedNoise {
min_limit_noise: PerlinNoise,
max_limit_noise: PerlinNoise,
main_noise: PerlinNoise,
xz_multiplier: f64,
y_multiplier: f64,
xz_factor: f64,
y_factor: f64,
smear_scale_multiplier: f64,
max_value: f64,
}Expand description
Runtime BlendedNoise sampler with three seeded PerlinNoise instances.
Matches vanilla’s BlendedNoise density function.
Fields§
§min_limit_noise: PerlinNoise§max_limit_noise: PerlinNoise§main_noise: PerlinNoise§xz_multiplier: f64§y_multiplier: f64§xz_factor: f64§y_factor: f64§smear_scale_multiplier: f64§max_value: f64Implementations§
Source§impl BlendedNoise
impl BlendedNoise
Sourcepub fn new(
random: &mut RandomSource,
xz_scale: f64,
y_scale: f64,
xz_factor: f64,
y_factor: f64,
smear_scale_multiplier: f64,
) -> Self
pub fn new( random: &mut RandomSource, xz_scale: f64, y_scale: f64, xz_factor: f64, y_factor: f64, smear_scale_multiplier: f64, ) -> Self
Create a new BlendedNoise from a random source and scale parameters.
This matches vanilla’s BlendedNoise(RandomSource, ...) constructor which
uses the legacy initialization path with createLegacyForBlendedNoise.
Sourcepub fn compute(&self, block_x: f64, block_y: f64, block_z: f64) -> f64
pub fn compute(&self, block_x: f64, block_y: f64, block_z: f64) -> f64
Compute the blended noise value at the given block coordinates.
Sourcepub fn compute_simd<const N: usize>(
&self,
block_x: f64,
block_ys: [f64; N],
block_z: f64,
) -> [f64; N]
pub fn compute_simd<const N: usize>( &self, block_x: f64, block_ys: [f64; N], block_z: f64, ) -> [f64; N]
Compute blended noise for N points sharing the same (x, z) but with different y values. Returns results as an array.
This uses SIMD to vectorize the math-heavy portions (gradient dots, smoothstep, trilinear lerp) across the N Y lanes, while sharing the x/z coordinate work.
Trait Implementations§
Source§impl Clone for BlendedNoise
impl Clone for BlendedNoise
Source§fn clone(&self) -> BlendedNoise
fn clone(&self) -> BlendedNoise
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BlendedNoise
impl RefUnwindSafe for BlendedNoise
impl Send for BlendedNoise
impl Sync for BlendedNoise
impl Unpin for BlendedNoise
impl UnsafeUnpin for BlendedNoise
impl UnwindSafe for BlendedNoise
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>