pub struct BlendedNoise {
min_limit_noise: SmearedStack,
max_limit_noise: SmearedStack,
main_noise: SmearedStack,
xz_multiplier: f64,
y_multiplier: f64,
main_xz_scale: f64,
main_y_scale: f64,
}Expand description
Runtime counterpart of vanilla’s 26.3 BlendedNoise sampler.
The old terrain sampler used double octave sums. Vanilla now builds three
NoiseStacks and carries float values through each layer and the final lerp.
Fields§
§min_limit_noise: SmearedStack§max_limit_noise: SmearedStack§main_noise: SmearedStack§xz_multiplier: f64§y_multiplier: f64§main_xz_scale: f64§main_y_scale: 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
Creates the three seeded NoiseStacks used for terrain generation.
Sourcepub fn compute(&self, block_x: f64, block_y: f64, block_z: f64) -> f32
pub fn compute(&self, block_x: f64, block_y: f64, block_z: f64) -> f32
Samples the blended terrain density at a block coordinate.
fn compute_y_simd<const N: usize>( &self, block_x: f64, block_ys: Simd<f64, N>, block_z: f64, ) -> Simd<f32, N>
Trait Implementations§
Source§impl Clone for BlendedNoise
impl Clone for BlendedNoise
Auto 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<>>