Skip to main content

NoiseProvider

Struct NoiseProvider 

Source
pub struct NoiseProvider { /* private fields */ }
Expand description

A built-in CPU fBm-terrain provider.

Implementations§

Trait Implementations§

Source§

impl CpuSurfaceProvider for NoiseProvider

Source§

fn bake(&self, frame: &FaceFrame, chunk: &Chunk, tile_res: u32) -> ChunkSurface

Resample this chunk’s surface at tile_res × tile_res. Called on a bake worker thread. A streaming provider may also enqueue any data it still needs (a side effect) so poll_refresh can later report the chunk for a re-bake once that data arrives.
Source§

fn sample_height(&self, dir: Vector3) -> Option<f32>

Surface displacement at dir, in the height buffer’s unit (multiply by height_scale · radius for world units). Steers LOD toward the displaced surface. None ⇒ no data (treated as sea level).
Source§

fn height_scale(&self) -> f32

Per-height-unit displaced-radius factor for the GPU: the surface radius becomes radius · (1 + height · height_scale).
Source§

fn poll_refresh(&self) -> Vec<Chunk>

Chunks whose awaited data has arrived and should be re-baked (streaming). Called each frame on the main thread; a non-streaming provider returns empty. Returns whole [Chunk]s (not just ids) so the caller can re-queue a bake directly.
Source§

fn set_wanted(&self, _ids: &HashSet<ChunkId>)

Camera-driven cancellation hint: the set of chunk ids still in view. Streaming providers drop bookkeeping / downloads for anything else.
Source§

fn base_ready(&self) -> bool

Is enough data present for the surface to be shown (the GPU surface_enabled gate)? A streaming provider returns false until its base map lands; a self-contained provider (noise) is always ready.
Source§

fn resources_in_flight(&self) -> usize

External resource fetches in flight (streaming providers; for the HUD).
Source§

fn cache_dir(&self) -> Option<String>

Absolute path of any on-disk cache this provider uses (for the HUD).

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