Skip to main content

DimensionNoises

Trait DimensionNoises 

Source
pub trait DimensionNoises:
    Sized
    + Send
    + Sync {
    type ColumnCache: ColumnCache<Noises = Self>;
    type Settings: NoiseSettings;

Show 32 methods // Required methods fn create( seed: u64, splitter: &RandomSplitter, params: &FxHashMap<String, NoiseParameters>, ) -> Self; fn router_final_density( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_depth( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_barrier( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_fluid_level_floodedness( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_fluid_level_spread( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_lava( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_vein_toggle( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_vein_ridged( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_vein_gap( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_erosion( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_continentalness( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_temperature( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_vegetation( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_ridges( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn router_preliminary_surface_level( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64; fn interpolated_count() -> usize; fn vein_interp_enabled() -> bool; fn fill_cell_corner_densities( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, blended_noise_value: f64, out: &mut [f64], ); fn combine_interpolated( &self, cache: &mut Self::ColumnCache, interpolated: &[f64], x: i32, y: i32, z: i32, ) -> f64; fn combine_vein_toggle( &self, cache: &mut Self::ColumnCache, interpolated: &[f64], x: i32, y: i32, z: i32, ) -> f64; fn combine_vein_ridged( &self, cache: &mut Self::ColumnCache, interpolated: &[f64], x: i32, y: i32, z: i32, ) -> f64; fn surface_noise_ids() -> &'static [&'static str]; fn surface_gradient_ids() -> &'static [&'static str]; fn surface_rule_block_states() -> &'static [BlockStateId]; fn surface_rule_uses_biome() -> bool; fn surface_rule_uses_preliminary_surface() -> bool; fn surface_rule_uses_surface_secondary() -> bool; fn surface_rule_uses_steep() -> bool; fn try_apply_surface_rule( ctx: &mut SurfaceRuleContext<'_>, ) -> Option<BlockStateId>; // Provided methods fn compute_noise_column( &self, _x: i32, _block_ys: &[i32], _z: i32, out: &mut [f64], ) { ... } fn fill_cell_corner_densities_4x( &self, cache: &mut Self::ColumnCache, x: i32, ys: f64x4, z: i32, blended_noise_values: f64x4, out: &mut [f64], ) { ... }
}
Expand description

All noise generators and density functions for a dimension.

This trait abstracts over dimension-specific noise types (OverworldNoises, NetherNoises, etc.) allowing generic code to work with any dimension.

Required Associated Types§

Source

type ColumnCache: ColumnCache<Noises = Self>

The column cache type for this dimension.

Source

type Settings: NoiseSettings

The noise settings type for this dimension.

Required Methods§

Source

fn create( seed: u64, splitter: &RandomSplitter, params: &FxHashMap<String, NoiseParameters>, ) -> Self

Create all noise generators from a world seed and its positional splitter.

Source

fn router_final_density( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Final density for terrain generation (positive = solid, negative = air).

Source

fn router_depth( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Depth from surface (used for terrain shaping).

Source

fn router_barrier( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Barrier noise for aquifer boundaries.

Source

fn router_fluid_level_floodedness( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Fluid level floodedness for aquifers.

Source

fn router_fluid_level_spread( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Fluid level spread for aquifers.

Source

fn router_lava( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Lava placement noise for aquifers.

Source

fn router_vein_toggle( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Vein toggle (sign determines copper vs iron).

Source

fn router_vein_ridged( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Vein ridged noise for ore placement.

Source

fn router_vein_gap( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Vein gap noise for ore vs filler placement.

Source

fn router_erosion( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Erosion value (cached in column cache).

Source

fn router_continentalness( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Continentalness value (cached in column cache).

Source

fn router_temperature( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Temperature value (cached in column cache).

Source

fn router_vegetation( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Vegetation/humidity value (cached in column cache).

Source

fn router_ridges( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Ridges/weirdness value (cached in column cache).

Source

fn router_preliminary_surface_level( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f64

Preliminary surface level (cached in column cache).

Source

fn interpolated_count() -> usize

Total number of independently interpolated channels across all router entries (final_density + vein_toggle + vein_ridged).

Source

fn vein_interp_enabled() -> bool

Whether vein functions have interpolation channels.

Source

fn fill_cell_corner_densities( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, blended_noise_value: f64, out: &mut [f64], )

Evaluate the inner functions of all Interpolated markers at a cell corner.

out must have length [interpolated_count()]. Each element receives the value of one Interpolated marker’s inner function at (x, y, z). blended_noise_value is the precomputed blended noise for this Y level.

Source

fn combine_interpolated( &self, cache: &mut Self::ColumnCache, interpolated: &[f64], x: i32, y: i32, z: i32, ) -> f64

Combine trilinearly interpolated values for final_density.

Source

fn combine_vein_toggle( &self, cache: &mut Self::ColumnCache, interpolated: &[f64], x: i32, y: i32, z: i32, ) -> f64

Combine trilinearly interpolated values for vein_toggle.

Source

fn combine_vein_ridged( &self, cache: &mut Self::ColumnCache, interpolated: &[f64], x: i32, y: i32, z: i32, ) -> f64

Combine trilinearly interpolated values for vein_ridged.

Source

fn surface_noise_ids() -> &'static [&'static str]

Noise IDs referenced by this dimension’s surface rule NoiseThreshold conditions. Used to construct the SurfaceSystem’s condition noises.

Source

fn surface_gradient_ids() -> &'static [&'static str]

Random IDs referenced by this dimension’s surface rule VerticalGradient conditions. Used to construct reusable positional random factories.

Source

fn surface_rule_block_states() -> &'static [BlockStateId]

Block states returned by this dimension’s generated surface rules.

Source

fn surface_rule_uses_biome() -> bool

Whether the generated surface rule reads biome-dependent context.

Source

fn surface_rule_uses_preliminary_surface() -> bool

Whether the generated surface rule reads preliminary surface level.

Source

fn surface_rule_uses_surface_secondary() -> bool

Whether the generated surface rule reads surface secondary noise.

Source

fn surface_rule_uses_steep() -> bool

Whether the generated surface rule reads steep-column context.

Source

fn try_apply_surface_rule( ctx: &mut SurfaceRuleContext<'_>, ) -> Option<BlockStateId>

Apply the transpiled surface rule at the given context position.

Provided Methods§

Source

fn compute_noise_column( &self, _x: i32, _block_ys: &[i32], _z: i32, out: &mut [f64], )

Compute blended noise for an entire column of Y values.

Called by NoiseChunk::fill_slice before iterating over Y corners. Dimensions that use BlendedNoise (e.g. overworld) should override this to SIMD-batch the blended noise computation.

Default: no-op (fills out with zeros).

Source

fn fill_cell_corner_densities_4x( &self, cache: &mut Self::ColumnCache, x: i32, ys: f64x4, z: i32, blended_noise_values: f64x4, out: &mut [f64], )

SIMD form of fill_cell_corner_densities that batches 4 cell-corner Y values at fixed (x, z).

out layout: lane-major SoA. Lane i’s interpolated_count() channels occupy out[i * interpolated_count()..(i + 1) * interpolated_count()]. out must have length 4 * interpolated_count().

The default implementation calls the scalar fill_cell_corner_densities four times. Dimensions can override with a true SIMD implementation (the transpiled compute_*_4x chain) once the SIMD codegen is in place.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§