pub trait DimensionNoises:
Sized
+ Send
+ Sync {
type ColumnCache: ColumnCache<Noises = Self>;
type Settings: NoiseSettings;
Show 40 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,
) -> f32;
fn router_depth(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_barrier(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_fluid_level_floodedness(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_fluid_level_spread(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_lava(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_vein_toggle(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_vein_ridged(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_vein_gap(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_erosion(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_continentalness(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_temperature(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_vegetation(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_ridges(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn router_preliminary_surface_level(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32;
fn interpolated_count() -> usize;
fn vein_interp_enabled() -> bool;
fn final_density_nonpositive_channels() -> Option<&'static [usize]>;
fn fill_cell_corner_densities(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
blended_noise_value: f32,
out: &mut [f32],
);
fn combine_interpolated(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
) -> f32;
fn combine_vein_toggle(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
) -> f32;
fn combine_vein_ridged(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
) -> f32;
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_biome_sets() -> &'static [Box<[u16]>];
fn surface_rule_below_preliminary_surface() -> &'static PartialSurfaceRule;
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>;
fn material_ore_vein_value_count() -> usize;
fn fill_material_ore_vein_values(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
out: &mut [f32],
);
fn fill_prefilled_material_ore_vein_results(
&self,
cache: &mut Self::ColumnCache,
ore_veinifier: &OreVeinifier,
values: &[f32],
x: i32,
y: i32,
z: i32,
out: &mut [Option<BlockStateId>],
);
// Provided methods
fn aquifer_needs_column_cache() -> bool { ... }
fn compute_noise_column(
&self,
_x: i32,
_block_ys: &[i32],
_z: i32,
out: &mut [f32],
) { ... }
fn fill_cell_corner_densities_y_simd<const N: usize>(
&self,
cache: &mut Self::ColumnCache,
x: i32,
ys: [i32; N],
z: i32,
blended_noise_values: [f32; N],
out: &mut [f32],
) { ... }
fn material_ore_vein_value_height() -> usize { ... }
}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§
Sourcetype ColumnCache: ColumnCache<Noises = Self>
type ColumnCache: ColumnCache<Noises = Self>
The column cache type for this dimension.
Sourcetype Settings: NoiseSettings
type Settings: NoiseSettings
The noise settings type for this dimension.
Required Methods§
Sourcefn create(
seed: u64,
splitter: &RandomSplitter,
params: &FxHashMap<String, NoiseParameters>,
) -> Self
fn create( seed: u64, splitter: &RandomSplitter, params: &FxHashMap<String, NoiseParameters>, ) -> Self
Create all noise generators from a world seed and its positional splitter.
Sourcefn router_final_density(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_final_density( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Final density for terrain generation (positive = solid, negative = air).
Sourcefn router_depth(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_depth( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Depth from surface (used for terrain shaping).
Sourcefn router_barrier(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_barrier( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Barrier noise for aquifer boundaries.
Sourcefn router_fluid_level_floodedness(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_fluid_level_floodedness( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Fluid level floodedness for aquifers.
Sourcefn router_fluid_level_spread(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_fluid_level_spread( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Fluid level spread for aquifers.
Sourcefn router_lava(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_lava( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Lava placement noise for aquifers.
Sourcefn router_vein_toggle(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_vein_toggle( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Vein toggle (sign determines copper vs iron).
Sourcefn router_vein_ridged(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_vein_ridged( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Vein ridged noise for ore placement.
Sourcefn router_vein_gap(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_vein_gap( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Vein gap noise for ore vs filler placement.
Sourcefn router_erosion(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_erosion( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Erosion value (cached in column cache).
Sourcefn router_continentalness(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_continentalness( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Continentalness value (cached in column cache).
Sourcefn router_temperature(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_temperature( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Temperature value (cached in column cache).
Sourcefn router_vegetation(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_vegetation( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Vegetation/humidity value (cached in column cache).
Sourcefn router_ridges(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_ridges( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Ridges/weirdness value (cached in column cache).
Sourcefn router_preliminary_surface_level(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
) -> f32
fn router_preliminary_surface_level( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, ) -> f32
Preliminary surface level (cached in column cache).
Sourcefn interpolated_count() -> usize
fn interpolated_count() -> usize
Total number of independently interpolated channels across all router
entries (final_density + vein_toggle + vein_ridged).
Sourcefn vein_interp_enabled() -> bool
fn vein_interp_enabled() -> bool
Whether vein functions have interpolation channels.
Sourcefn final_density_nonpositive_channels() -> Option<&'static [usize]>
fn final_density_nonpositive_channels() -> Option<&'static [usize]>
Interpolated channels that, when <= 0 at a block, prove its combined
final density is not positive. Cell corners alone are insufficient for
Vanilla’s repeated-addition interpolation.
Derived by the transpiler from the final-density tree; None when no
such proof exists.
Sourcefn fill_cell_corner_densities(
&self,
cache: &mut Self::ColumnCache,
x: i32,
y: i32,
z: i32,
blended_noise_value: f32,
out: &mut [f32],
)
fn fill_cell_corner_densities( &self, cache: &mut Self::ColumnCache, x: i32, y: i32, z: i32, blended_noise_value: f32, out: &mut [f32], )
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.
Sourcefn combine_interpolated(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
) -> f32
fn combine_interpolated( &self, cache: &mut Self::ColumnCache, interpolated: &[f32], x: i32, y: i32, z: i32, ) -> f32
Combine trilinearly interpolated values for final_density.
Sourcefn combine_vein_toggle(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
) -> f32
fn combine_vein_toggle( &self, cache: &mut Self::ColumnCache, interpolated: &[f32], x: i32, y: i32, z: i32, ) -> f32
Combine trilinearly interpolated values for vein_toggle.
Sourcefn combine_vein_ridged(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
) -> f32
fn combine_vein_ridged( &self, cache: &mut Self::ColumnCache, interpolated: &[f32], x: i32, y: i32, z: i32, ) -> f32
Combine trilinearly interpolated values for vein_ridged.
Sourcefn surface_noise_ids() -> &'static [&'static str]
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.
Sourcefn surface_gradient_ids() -> &'static [&'static str]
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.
Sourcefn surface_rule_block_states() -> &'static [BlockStateId]
fn surface_rule_block_states() -> &'static [BlockStateId]
Block states returned by this dimension’s generated surface rules.
Sourcefn surface_rule_uses_biome() -> bool
fn surface_rule_uses_biome() -> bool
Whether the generated surface rule reads biome-dependent context.
Sourcefn surface_rule_biome_sets() -> &'static [Box<[u16]>]
fn surface_rule_biome_sets() -> &'static [Box<[u16]>]
Distinct biome_is sets the generated surface rule tests, as biome
registry ids. Together with a biome’s temperature parameters these are
everything the rule can observe about a biome.
Sourcefn surface_rule_below_preliminary_surface() -> &'static PartialSurfaceRule
fn surface_rule_below_preliminary_surface() -> &'static PartialSurfaceRule
The surface rule reduced to what is decidable from Y and biome below the preliminary surface.
Sourcefn surface_rule_uses_preliminary_surface() -> bool
fn surface_rule_uses_preliminary_surface() -> bool
Whether the generated surface rule reads preliminary surface level.
Sourcefn surface_rule_uses_surface_secondary() -> bool
fn surface_rule_uses_surface_secondary() -> bool
Whether the generated surface rule reads surface secondary noise.
Sourcefn surface_rule_uses_steep() -> bool
fn surface_rule_uses_steep() -> bool
Whether the generated surface rule reads steep-column context.
Sourcefn try_apply_surface_rule(
ctx: &mut SurfaceRuleContext<'_>,
) -> Option<BlockStateId>
fn try_apply_surface_rule( ctx: &mut SurfaceRuleContext<'_>, ) -> Option<BlockStateId>
Apply the transpiled surface rule at the given context position.
Sourcefn material_ore_vein_value_count() -> usize
fn material_ore_vein_value_count() -> usize
Number of prefilled density/richness values for this dimension’s material ore rules.
Sourcefn fill_material_ore_vein_values(
&self,
cache: &mut Self::ColumnCache,
interpolated: &[f32],
x: i32,
y: i32,
z: i32,
out: &mut [f32],
)
fn fill_material_ore_vein_values( &self, cache: &mut Self::ColumnCache, interpolated: &[f32], x: i32, y: i32, z: i32, out: &mut [f32], )
Fill one block’s material ore density/richness values.
Vanilla samples these functions over the complete chunk volume before
surface rules start evaluating. out has
Self::material_ore_vein_value_count entries, two per ore rule.
Sourcefn fill_prefilled_material_ore_vein_results(
&self,
cache: &mut Self::ColumnCache,
ore_veinifier: &OreVeinifier,
values: &[f32],
x: i32,
y: i32,
z: i32,
out: &mut [Option<BlockStateId>],
)
fn fill_prefilled_material_ore_vein_results( &self, cache: &mut Self::ColumnCache, ore_veinifier: &OreVeinifier, values: &[f32], x: i32, y: i32, z: i32, out: &mut [Option<BlockStateId>], )
Evaluates each ore-vein node from this dimension’s material rule using density/richness values prefilled for this exact block position.
out is ordered by the material-rule tree’s depth-first traversal, so
generated rule code can preserve vanilla’s sequence ordering.
Provided Methods§
Sourcefn aquifer_needs_column_cache() -> bool
fn aquifer_needs_column_cache() -> bool
Whether aquifer noise lookups require a prepared column cache.
Returning false promises that barrier, floodedness, spread and lava
all use their explicit coordinates without reading prepared cache values.
Custom implementations retain column-cache preparation by default.
Sourcefn compute_noise_column(
&self,
_x: i32,
_block_ys: &[i32],
_z: i32,
out: &mut [f32],
)
fn compute_noise_column( &self, _x: i32, _block_ys: &[i32], _z: i32, out: &mut [f32], )
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).
Sourcefn fill_cell_corner_densities_y_simd<const N: usize>(
&self,
cache: &mut Self::ColumnCache,
x: i32,
ys: [i32; N],
z: i32,
blended_noise_values: [f32; N],
out: &mut [f32],
)
fn fill_cell_corner_densities_y_simd<const N: usize>( &self, cache: &mut Self::ColumnCache, x: i32, ys: [i32; N], z: i32, blended_noise_values: [f32; N], out: &mut [f32], )
Evaluate a batch of Y corners at the same X/Z position.
The generated dimension implementations use the best SIMD width for the target. The default keeps the same lane-major output layout while providing a scalar fallback for dimensions without generated SIMD code.
Sourcefn material_ore_vein_value_height() -> usize
fn material_ore_vein_value_height() -> usize
Height of the prefilled Y prefix, starting at NoiseSettings::MIN_Y.
Keep it within HEIGHT; every omitted ore density must be <= 0.0.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".